diff --git a/gdb/testsuite/gdb.threads/next-fork-other-thread.c b/gdb/testsuite/gdb.threads/next-fork-other-thread.c index 377c1bc1a31..5bcdabe0464 100644 --- a/gdb/testsuite/gdb.threads/next-fork-other-thread.c +++ b/gdb/testsuite/gdb.threads/next-fork-other-thread.c @@ -44,7 +44,7 @@ forker (void *arg) do { ret = waitpid (pid, &stat, 0); - } while (ret == EINTR); + } while (ret == -1 && errno == EINTR); assert (ret == pid); assert (WIFEXITED (stat));