Re: O_CLOEXEC support (was: popen bugs, popen_safer)

2009-08-22 Thread Bruno Haible
Eric Blake wrote: > we also need to > tweak the O_NOINHERIT flag of an existing fd without having to use dup in > cloexec.c (I'm hoping the windows functions GetHandleInformation and > SetHandleInformation work here). I don't see how to make it work without a lot of dup() calls and without assumin

Re: popen bugs, popen_safer

2009-08-21 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 8/20/2009 2:14 AM: > This is becoming confusing: Why should the 'fopen' test suddenly test > fopen_safer, > not fopen?? > > I would find it better to introduce a new test module fopen-safer-tests, that > shares > the bul

Re: popen bugs, popen_safer

2009-08-20 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 8/20/2009 2:14 AM: > Hi Eric, > >> I went ahead and implemented popen_safer. > > Well done! > >> +/* Get the original definition of popen. It might be defined as a macro. >> */ > > This is not needed. I'm not aware o

Re: popen bugs, popen_safer

2009-08-20 Thread Bruno Haible
Hi Eric, > I went ahead and implemented popen_safer. Well done! > +/* Get the original definition of popen. It might be defined as a macro. */ This is not needed. I'm not aware of any platform that defines popen as a macro: $ LC_ALL=C fgrep popen */usr/include/stdio.h aix-4.3.2/usr/include/st

O_CLOEXEC support (was: popen bugs, popen_safer)

2009-08-19 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 8/19/2009 11:06 AM: > I went ahead and implemented popen_safer. And this patch also includes a first use of O_CLOEXEC; I'm debating about adding more O_CLOEXEC support throughout gnulib, a piece at a time. cloexec support ha

Re: popen bugs, popen_safer

2009-08-19 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 8/17/2009 5:14 PM: > Even though Bruno's pipe module is generally a better > interface than popen, I discovered yet another popen > bug in cygwin today[1] (I fixed a cygwin popen bug in > August 2006, only to have it regress

popen bugs, popen_safer

2009-08-17 Thread Eric Blake
Even though Bruno's pipe module is generally a better interface than popen, I discovered yet another popen bug in cygwin today[1] (I fixed a cygwin popen bug in August 2006, only to have it regress in December of that year when cgf rewrote the implementation to be faster). So even though m4 no lo