libubus: fix build error in examples/server
authorZefir Kurtisi <zefir.kurtisi@neratec.com>
Wed, 17 Sep 2014 10:33:32 +0000 (12:33 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 17 Sep 2014 11:29:30 +0000 (13:29 +0200)
This fixes build warning:
/ubus.git/examples/server.c: In function 'test_hello_reply':
/ubus.git/examples/server.c:69:6: error: ignoring return value of 'pipe', declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
examples/server.c

index bbb3347c0d252f4de9035caa5afa609d6a47675e..b8b751e715a8b82d5f0478a39c5ac73991678ec6 100644 (file)
@@ -66,7 +66,10 @@ static void test_hello_reply(struct uloop_timeout *t)
        blobmsg_add_string(&b, "message", req->data);
        ubus_send_reply(ctx, &req->req, b.head);
 
-       pipe(fds);
+       if (pipe(fds) == -1) {
+               fprintf(stderr, "Failed to create pipe\n");
+               return;
+       }
        ubus_request_set_fd(ctx, &req->req, fds[0]);
        ubus_complete_deferred_request(ctx, &req->req, 0);
        req->fd = fds[1];