projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3d64d4
)
[gdb/testsuite] Fix waitpid testing in next-fork-other-thread.c
author
Tom de Vries
<tdevries@suse.de>
Sun, 2 Oct 2022 18:18:00 +0000
(20:18 +0200)
committer
Tom de Vries
<tdevries@suse.de>
Sun, 2 Oct 2022 18:18:00 +0000
(20:18 +0200)
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.
gdb/testsuite/gdb.threads/next-fork-other-thread.c
patch
|
blob
|
history
diff --git
a/gdb/testsuite/gdb.threads/next-fork-other-thread.c
b/gdb/testsuite/gdb.threads/next-fork-other-thread.c
index 377c1bc1a31e70bb1209927eb6cab7cae4ef825f..5bcdabe0464caa3a8175562fe63b248e2ca09225 100644
(file)
--- 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));