From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id C18F73858438; Sun, 9 Jul 2023 16:01:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C18F73858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688918509; bh=oQagjMOZ5A8PwsrYJIAbxP8Jgv9CkrhP+kigv9uQeuw=; h=From:To:Subject:Date:From; b=ZC36jHlqOWKail7HnDquGmhno/cFj0H5fFi8UFYkn8GYBBItQR3hgilTY08hzLRaw /GZu9FVm4erC69ajH89fMPwtCbOrj8/5Bqy/l0asa/4bAHwo5dxOEvPBgpfHcCeaat 9wBHHJPNI+bzVJ/nrAUKFJXYBZPus88+bG5q9J+E= 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: 7fcb2cd4a17bd5e07e104f8c82e403c25847c053 X-Git-Newrev: f5940dc449177a3b6216515855964b0c8815954f Message-Id: <20230709160149.C18F73858438@sourceware.org> Date: Sun, 9 Jul 2023 16:01:49 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Df5940dc4491= 77a3b6216515855964b0c8815954f commit f5940dc449177a3b6216515855964b0c8815954f 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. (This is a lot easier to debug when it's completely broken by environme= nt) 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..a47586fdb 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() 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() call in child process returned %x\n", n); exit (1); } exit (0);