]> granicus.if.org Git - libevent/commitdiff
Check return value of write() in regress.c
authorNick Mathewson <nickm@torproject.org>
Fri, 29 Jun 2012 16:47:03 +0000 (12:47 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 29 Jun 2012 16:47:03 +0000 (12:47 -0400)
test/regress.c

index b736d89143ac94b16695c9ff2e9141f1372549d6..0ab93a98a8d5d5652cd2b82a3308b8cc4601e650 100644 (file)
@@ -1357,8 +1357,8 @@ static void
 write_a_byte_cb(evutil_socket_t fd, short what, void *arg)
 {
        char buf[] = "x";
-       write(fd, buf, 1);
-       ++n_write_a_byte_cb;
+       if (write(fd, buf, 1) == 1)
+               ++n_write_a_byte_cb;
 }
 static void
 read_and_drain_cb(evutil_socket_t fd, short what, void *arg)