From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix waitpid testing in next-fork-other-thread.c
Date: Sun, 2 Oct 2022 20:18:16 +0200 [thread overview]
Message-ID: <20221002181814.GA6367@delia.home> (raw)
Hi,
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.
Committed to trunk.
Thanks,
- Tom
[gdb/testsuite] Fix waitpid testing in next-fork-other-thread.c
---
gdb/testsuite/gdb.threads/next-fork-other-thread.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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));
reply other threads:[~2022-10-02 18:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221002181814.GA6367@delia.home \
--to=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox