From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74696 invoked by alias); 7 Feb 2019 16:14:52 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 74678 invoked by uid 89); 7 Feb 2019 16:14:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=folks, H*M:e6eb X-HELO: atfriesa01.ssi-schaefer.com Received: from atfriesa01.ssi-schaefer.com (HELO atfriesa01.ssi-schaefer.com) (193.186.16.100) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Feb 2019 16:14:49 +0000 Received: from samail03.wamas.com (HELO mailhost.salomon.at) ([172.28.33.235]) by atfriesa01.ssi-schaefer.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2019 17:14:47 +0100 Received: from fril0049.wamas.com ([172.28.42.244]) by mailhost.salomon.at with esmtp (Exim 4.77) (envelope-from ) id 1grmK6-0000C5-NM; Thu, 07 Feb 2019 17:14:46 +0100 Subject: Re: [ANNOUNCEMENT] TEST: Cygwin 3.0.0-0.7 References: From: Michael Haubenwallner To: cygwin@cygwin.com Openpgp: preference=signencrypt Message-ID: <02da4eeb-fcce-b1bc-e6eb-68ff3ec0cf74@ssi-schaefer.com> Date: Thu, 07 Feb 2019 16:14:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-02/txt/msg00061.txt.bz2 On 2/5/19 4:18 PM, Corinna Vinschen wrote: > Hi folks, > > > I uploaded a new Cygwin test release 3.0.0-0.7 > > Please test. > There's another regression - regarding spawn, exec and waitpid, loosing the exitstatus somewhere in between: $ cat > dospawn.c < #include #include #include int main(int argc, char const **argv) { if (argc > 1) { int pid = spawnv(_P_NOWAITO, argv[1], &argv[1]); if (pid) { int status = 0; pid_t wpid = waitpid(pid, &status, 0); if (wpid > 0) { printf("waitpid: pid %d status 0x%x\n", pid, status); if (WIFEXITED(status)) { int ret = WEXITSTATUS(status); return ret; } } } } return 127; } EOF $ gcc dospawn.c -o dospawn $ ./dospawn /bin/bash -c /bin/false waitpid: pid 123 status 0x0 <= 2.11.2 does provide status 0x100 as expected $ echo $? 0 <= Actually I do expect the exit status of /bin/false to show up here. It is important to have the exec() in between: $ ./dospawn /bin/false waitpid: pid 123 status 0x100 $ echo $? 1 Note that bash does detect it can simply exec("/bin/false"). With more complex commands bash does not just exec(): $ ./dospawn /bin/bash -c ':; /bin/false' waitpid: pid 123 status 0x100 $ echo $? 1 /haubi/ -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple