ry / ebb fork watch download tarball
public
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Search Repo:
Take statements with side effects out of assert() calls

They would not be ever executed if compiled with -DNDEBUG
gnosek (author)
Mon Mar 24 06:51:50 -0700 2008
commit  c1567cb931b353f65b61beeef6bb413d1c88c280
tree    aded7c9698576304f4dfce6c699d37b20e3ad27a
parent  5fb8170d45ed424e73c51ad58874c99beb2ced76
...
130
131
132
133
 
 
134
135
136
...
229
230
231
232
 
 
233
234
235
...
130
131
132
 
133
134
135
136
137
...
230
231
232
 
233
234
235
236
237
0
@@ -130,7 +130,8 @@
0
   
0
   /* set blocking socket */
0
   int flags = fcntl(client->fd, F_GETFL, 0);
0
- assert(0 <= fcntl(client->fd, F_SETFL, flags & ~O_NONBLOCK));
0
+ int ret = fcntl(client->fd, F_SETFL, flags & ~O_NONBLOCK);
0
+ assert(0 <= ret);
0
   
0
   sprintf(client->upload_filename, "/tmp/ebb_upload_%010d", id++);
0
   tmpfile = fopen(client->upload_filename, "w+");
0
@@ -229,7 +230,8 @@
0
       /* read body into file - in a thread */
0
       ev_io_stop(loop, watcher);
0
       pthread_t thread;
0
- assert(0 <= pthread_create(&thread, NULL, read_body_into_file, client));
0
+ int ret = pthread_create(&thread, NULL, read_body_into_file, client);
0
+ assert(0 <= ret);
0
       pthread_detach(thread);
0
       return;
0
     }

Comments

    No one has commented yet.