mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 02:50:08 +08:00
[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:
@ -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));
|
||||
|
Reference in New Issue
Block a user