From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id C699D3858407; Fri, 14 Jul 2023 15:28:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C699D3858407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689348498; bh=rA5Mgjp9j+0EBuZC7SnVKcqa2r73g+0TBpZVpnsfyH0=; h=From:To:Subject:Date:From; b=blD32u6pAutoUIEtl3/VWlzXDMx00WEGPn4xxTILyqddBXgHcYxcvUJ2NZSM0Gs8h 8JFEFoHPAcb+ntO/narNEMJ/eSUZpjkG95P5UT1Eb62HUxnyU8Z8VgqpQmH0D02+zy cDfUwToSbh5m609nBpDg0A0nujwyb9JVYSpE/Qy4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jon Turney To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: testsuite: Also check direct call in systemcall X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: 7c0750e96294c4c565fadc662219d56f93af389d X-Git-Newrev: 79a9288434aaa15407727474f26504214b027306 Message-Id: <20230714152818.C699D3858407@sourceware.org> Date: Fri, 14 Jul 2023 15:28:18 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D79a9288434a= aa15407727474f26504214b027306 commit 79a9288434aaa15407727474f26504214b027306 Author: Jon Turney Date: Sun Jul 9 12:12:23 2023 +0100 Cygwin: testsuite: Also check direct call in systemcall =20 Check direct call to system(), as well as one in a subprocess. =20 (This is a lot easier to debug when it's completely broken by the environment the test is running in) =20 Signed-off-by: Jon Turney Diff: --- winsup/testsuite/winsup.api/systemcall.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/winsup/testsuite/winsup.api/systemcall.c b/winsup/testsuite/wi= nsup.api/systemcall.c index d10c9825c..74bd6f870 100644 --- a/winsup/testsuite/winsup.api/systemcall.c +++ b/winsup/testsuite/winsup.api/systemcall.c @@ -26,6 +26,14 @@ main (int argc, char **argv) fprintf (stderr, "couldn't redirect stdout to /dev/null, fd %d - %s\= n", fd, strerror (errno)); exit (1); } + + n =3D system ("ls"); + if (n !=3D 0) + { + fprintf (stderr, "system() (in parent) call returned %x\n", n); + exit (1); + } + if (pipe (fds)) { fprintf (stderr, "pipe call failed - %s\n", strerror (errno)); @@ -61,7 +69,7 @@ main (int argc, char **argv) } if (n !=3D 0) { - fprintf (stderr, "system() call returned %x\n", n); + fprintf (stderr, "system() (in child) call returned %x\n", n); exit (1); } exit (0);