tevent:threads: fix -O3 error unused result of write
authorMichael Adam <obnox@samba.org>
Wed, 23 Mar 2016 00:41:17 +0000 (01:41 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 12 May 2016 22:16:14 +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_threads.c

index 8d44e4f8f5f8c18d9ddfa7e14e4001e4065bdb8c..15882e4f40bd8842c19febc6c5679f1f74677d83 100644 (file)
@@ -310,6 +310,7 @@ void tevent_thread_proxy_schedule(struct tevent_thread_proxy *tp,
        struct tevent_immediate_list *im_entry;
        int ret;
        char c;
+       ssize_t written;
 
        ret = pthread_mutex_lock(&tp->mutex);
        if (ret != 0) {
@@ -341,7 +342,9 @@ void tevent_thread_proxy_schedule(struct tevent_thread_proxy *tp,
 
        /* And notify the dest_ev_ctx to wake up. */
        c = '\0';
-       (void)write(tp->write_fd, &c, 1);
+       do {
+               written = write(tp->write_fd, &c, 1);
+       } while (written == -1 && errno == EINTR);
 
   end: