[gdb/testsuite] Fix waitpid testing in next-fork-other-thread.c

In next-fork-other-thread.c, there's this loop:
...
      do
        {
          ret = waitpid (pid, &stat, 0);
        } while (ret == EINTR);
...

The loop condition tests for "ret == EINTR" but waitpid signals EINTR by
returning -1 and setting errno to EINTR.

Fix this by changing the loop condition to "ret == -1 && errno == EINTR".

Tested on x86_64-linux.
This commit is contained in:
Tom de Vries
2022-10-02 20:18:00 +02:00
parent c3d64d467d
commit 4cfa9edb35

View File

@ -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));