tevent:signal: fix -O3 error unused result of read
authorMichael Adam <obnox@samba.org>
Wed, 23 Mar 2016 01:23:35 +0000 (02:23 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 12 May 2016 22:16:15 +0000 (00:16 +0200)
some compilers don't tolerate void-casting for warn_unused_result

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
lib/tevent/tevent_signal.c

index 8a0caae8136d4d7d77665c3af6ae1de44c195bdb..635a7a177aa976b8e9c62f7dd6b221eb5b665abc 100644 (file)
@@ -238,9 +238,13 @@ static int tevent_signal_destructor(struct tevent_signal *se)
 static void signal_pipe_handler(struct tevent_context *ev, struct tevent_fd *fde, 
                                uint16_t flags, void *_private)
 {
+       ssize_t ret;
+
        char c[16];
        /* its non-blocking, doesn't matter if we read too much */
-       (void) read(fde->fd, c, sizeof(c));
+       do {
+               ret = read(fde->fd, c, sizeof(c));
+       } while (ret == -1 && errno == EINTR);
 }
 
 /*