tdb:torture: fix -O3 error unused result code of read
[samba.git] / lib / tdb / tools / tdbtorture.c
index e4b8f6991a70adb1a4f683e059ac2021ffe4f571..331a459ddbb148a8c272c3b0d529d11b5390cbff 100644 (file)
@@ -427,8 +427,12 @@ int main(int argc, char * const *argv)
                            || WTERMSIG(status) == SIGUSR1) {
                                /* SIGUSR2 means they wrote to pipe. */
                                if (WTERMSIG(status) == SIGUSR2) {
-                                       read(pfds[0], &done[j],
-                                            sizeof(done[j]));
+                                       ssize_t ret;
+
+                                       do {
+                                               ret = read(pfds[0], &done[j],
+                                                          sizeof(done[j]));
+                                       } while (ret == -1 && errno == EINTR);
                                }
                                pids[j] = fork();
                                if (pids[j] == 0)