tdb:torture: fix -O3 error unused result of write
authorMichael Adam <obnox@samba.org>
Wed, 23 Mar 2016 01:47:13 +0000 (02:47 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 12 May 2016 22:16:15 +0000 (00:16 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>
lib/tdb/tools/tdbtorture.c

index 331a459..3640dc7 100644 (file)
@@ -223,8 +223,12 @@ static void usage(void)
 
 static void send_count_and_suicide(int sig)
 {
+       ssize_t ret;
+
        /* This ensures our successor can continue where we left off. */
-       write(count_pipe, &loopnum, sizeof(loopnum));
+       do {
+               ret = write(count_pipe, &loopnum, sizeof(loopnum));
+       } while (ret == -1 && errno == EINTR);
        /* This gives a unique signature. */
        kill(getpid(), SIGUSR2);
 }