From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 41A443858D32; Sun, 2 Oct 2022 18:18:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41A443858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664734683; bh=x550wMmd2SKBamJakz5QF15MVD0T3+xrYU8CSaoOCoc=; h=From:To:Subject:Date:From; b=qnJ8Xjk0n+YQGlNSOZkDVPYvs5TLlnV3PtzJEdL3Qb7CmLUaR97waA1GWNpkkVuEI hqM0Ot0Vm0IxHJ5NvsQPY2CQN0FyrQkzbIhHLUoy73QVaIqIoVSFL7h/LidxyjBFMd jj2LY4Z5LsqmYEHcl14oL59LoMkmgVKQ12fID8C4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix waitpid testing in next-fork-other-thread.c X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: c3d64d467d49edd8ac226679553686034d004c13 X-Git-Newrev: 4cfa9edb35736ddf4efd2bd8ccc885349dc69b8e Message-Id: <20221002181803.41A443858D32@sourceware.org> Date: Sun, 2 Oct 2022 18:18:03 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4cfa9edb3573= 6ddf4efd2bd8ccc885349dc69b8e commit 4cfa9edb35736ddf4efd2bd8ccc885349dc69b8e Author: Tom de Vries Date: Sun Oct 2 20:18:00 2022 +0200 [gdb/testsuite] Fix waitpid testing in next-fork-other-thread.c =20 In next-fork-other-thread.c, there's this loop: ... do { ret =3D waitpid (pid, &stat, 0); } while (ret =3D=3D EINTR); ... =20 The loop condition tests for "ret =3D=3D EINTR" but waitpid signals EIN= TR by returning -1 and setting errno to EINTR. =20 Fix this by changing the loop condition to "ret =3D=3D -1 && errno =3D= =3D EINTR". =20 Tested on x86_64-linux. Diff: --- 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/tests= uite/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 =3D waitpid (pid, &stat, 0); - } while (ret =3D=3D EINTR); + } while (ret =3D=3D -1 && errno =3D=3D EINTR); =20 assert (ret =3D=3D pid); assert (WIFEXITED (stat));