delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; q=dns; s= | |
default; b=c0YNJWBLgcGEJ202m/QAqOY2JsTdGB4KTS7L5UZvsJ7aZatbQKmbq | |
fUiqMw8KQgwHsx5YwcEDS1Iqfbu0ldS2eYOMcOpXVPhpm4ZEjXu0lcBC6RWgxx4M | |
4XAlixxlaabOWxAYP40pG9kFXkO7PalV9fNQwuiZKqIgMFL8GKpKhc= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; s=default; | |
bh=n8uA8JJq0VnG5/xiE5DoHlVh6zw=; b=X22vHjGXJtssVf8+YQKcuBLi9Mxm | |
mY3yCWr708VyD0diLvPzG+ggKgz8sw6GHgnPk80540UY1IuRpJ+6NU2qJo9uWuBP | |
S01m48u8JIe1UDjFP5QFgt/9m+i6sadlrTdQ8QI65dViNS3QHNNZqKk0RP2G542s | |
MU7OBv6HvEdxq/U= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Authentication-Results: | sourceware.org; auth=none |
X-Virus-Found: | No |
X-Spam-SWARE-Status: | No, score=-0.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 |
X-HELO: | calimero.vinschen.de |
Date: | Mon, 13 Jan 2014 16:03:53 +0100 |
From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: nested popen()'s lead to fgets() failure on 64-bit only |
Message-ID: | <20140113150353.GA24764@calimero.vinschen.de> |
Reply-To: | cygwin AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
References: | <25675-1389623735 DOT 405019 AT VSdY DOT Cv9S DOT eTM_> |
MIME-Version: | 1.0 |
In-Reply-To: | <25675-1389623735.405019@VSdY.Cv9S.eTM_> |
User-Agent: | Mutt/1.5.21 (2010-09-15) |
--u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jan 13 09:35, David Levine wrote: > Corinna wrote: >=20 > > That's the version number of the setup-x86_64.exe tool, not the version > > number of Cygwin. Try `uname -r'. >=20 > 1.7.27(0.271/5/3) >=20 > > Maybe you're calling the wrong file command? What's your $PATH set to? > > What if you change your popen call to run /usr/bin/file.exe with full > > path? > >=20 > > if ((f2 =3D popen("/usr/bin/file --mime-type /usr/bin/file.exe", "r")= )) >=20 > My PATH picks /usr/bin/file, but just to be sure I hard coded it, > and also used it for the first popen(), and also set PATH to /usr/bin: >=20 > $ gcc -o nested_popen nested_popen.c -Wall -Wextra && \ > PATH=3D/usr/bin ./nested_popen > buf1 =3D /usr/bin/file.exe: application/x-dosexec > popen: No error > fgets2 EOF Looks like this here: $ ./popen-test buf1 =3D /usr/bin/file.exe: application/x-dosexec popen: No error buf2 =3D /usr/bin/file.exe: application/x-dosexec > It shouldn't be at EOF in this case. If I change the > second popen() to open anything, e.g., > popen("garbage,really", "r"), it still reports success. Looks like this here: $ ./popen-test buf1 =3D /usr/bin/file.exe: application/x-dosexec popen: No error /bin/sh: garbage.really: command not found fgets2 EOF Same as on Linux: $ ./popen-test buf1 =3D /usr/bin/file: application/x-executable popen: Success buf2 =3D /usr/bin/file: application/x-executable $ ./popen-test buf1 =3D /usr/bin/file: application/x-executable popen: Success sh: garbage.really: command not found fgets2 EOF > We're getting closer? Not really. I have no idea why this fails for you. Does an strace show anything suspicious? Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJS1ABZAAoJEPU2Bp2uRE+g8scP/1sApmjsv8SMYBTFEsCHvix1 BTKHo7jGMUZBWrNPhxFTdLhHBNePFw4W9Mf1eTweMbzwXOez07Ndmn5AyHTQ49Dq Gb7gJncK7thO3EiNrp7zJoic0rQStkIQq78YVk1YjFDM++S93mlLhx94rtCVq4gS 8aPxvnclr6+tfAp+3DMU/Jmbpft9X8QwDI4l8J6JbGSvCKeULAICLgg1cYxNZpOy drXPW5vZZm0gb/iqPa5bCIxihlO4BW7GdidTJZs/dm3qX8Eq+/rOpOOOusDByc1O fPqXMWJAc5A/p272eVLClIGYbaC/YB0BapprvaRwrL0aswIWqjeNbNx28pmQHlZ9 2Kl8VPHhr//BZQP9pHyLwCCVYRyUTo2RxtaJJBHOBLheh73XsL7YHA9EccelefA+ BAoWQj8etkNejI60qx6vwpgHxv8tWLjlvHOu9Up6XTD60EFPN7pLEpFnnySQ/445 x9nBlqjTcYMJFIyoqSzo+s9uGjFi+v6ZCqQe0SuJu7uPaMh6uu8iuU8z29yvUaUj NMG/+XBD9+d5in1Mgt0KCVICGcwFhDJzRXui7C7BIwTBicZVLzDmQqctlSAsYLGT bHuZHolSQhtiiz7Pl4Uqs6FLZnI+rEfiORzhAICIQJ4s5qnP3PbLjGU4wVVy92y/ BV7oPMpTPBNiMhTePAoK =opvv -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |