]> granicus.if.org Git - libevent/commitdiff
test: fix warning
authorVincent JARDIN <vincent.jardin@6wind.com>
Mon, 11 Sep 2017 19:56:30 +0000 (21:56 +0200)
committerAzat Khuzhin <azat@libevent.org>
Sat, 2 Feb 2019 12:13:53 +0000 (15:13 +0300)
In function ‘send_a_byte_cb’:
test/regress.c:1853:2: warning: ignoring return value of ‘write’, declared with
attribute warn_unused_result [-Wunused-result]
  (void) write(*sockp, "A", 1);

(cherry picked from commit 56010f37ae5b49881f7fd255d5c8a936e1c36909)

test/regress.c

index f86963fa147e1466008350e0f3c8d40468f6364e..88e9b25990ff9ca5a97cd9ffa26f38548532a797 100644 (file)
@@ -1850,7 +1850,8 @@ static void send_a_byte_cb(evutil_socket_t fd, short what, void *arg)
 {
        evutil_socket_t *sockp = arg;
        (void) fd; (void) what;
-       (void) write(*sockp, "A", 1);
+       if (write(*sockp, "A", 1) < 0)
+               tt_fail_perror("write");
 }
 struct read_not_timeout_param
 {