[pacman-dev] [PATCH] Use O_CLOEXEC as much as possible when opening files

Dave Reisner d at falconindy.com
Tue Jul 16 14:31:22 EDT 2013


On Tue, Jul 16, 2013 at 08:27:03PM +0200, Ross Lagerwall wrote:
> On Mon, Jul 15, 2013 at 07:26:04PM -0500, Dan McGee wrote:
> > > Compile error:
> > >
> > >   CC       libalpm_la-log.lo
> > > In file included from /usr/include/fcntl.h:296:0,
> > >                  from util.h:41,
> > >                  from <command-line>:27:
> > > In function 'open',
> > >     inlined from 'alpm_logaction' at <command-line>:52:3:
> > > /usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode'
> > > declared with attribute error: open with O_CREAT in second argument
> > > needs 3 arguments
> > >     __open_missing_mode ();
> > >                         ^
> > 
> > I just saw this too, was compiling with clang earlier and it doesn't
> > warn on this. Weird!
> > 
> > I'll submit an updated version later tonight.
> > 
> 
> Could you not use the "e" flag to fopen?  It is available since glibc
> 2.7 (I'm not sure if there are targets that have O_CLOEXEC that don't
> support the "e" flag).
> 
> -- 
> Ross Lagerwall
> 

This is a glibc extension. BSD doesn't support this.


More information about the pacman-dev mailing list