diff options
author | Tom de Vries <tdevries@suse.de> | 2022-10-02 20:18:00 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2022-10-02 20:18:00 +0200 |
commit | 4cfa9edb35736ddf4efd2bd8ccc885349dc69b8e (patch) | |
tree | 1f6e20ce87661d68901c52c0d4ace12e734e41fe | |
parent | c3d64d467d49edd8ac226679553686034d004c13 (diff) | |
download | gdb-4cfa9edb35736ddf4efd2bd8ccc885349dc69b8e.zip gdb-4cfa9edb35736ddf4efd2bd8ccc885349dc69b8e.tar.gz gdb-4cfa9edb35736ddf4efd2bd8ccc885349dc69b8e.tar.bz2 |
[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.
-rw-r--r-- | gdb/testsuite/gdb.threads/next-fork-other-thread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.threads/next-fork-other-thread.c b/gdb/testsuite/gdb.threads/next-fork-other-thread.c index 377c1bc..5bcdabe 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)); |