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

Ross Lagerwall rosslagerwall at gmail.com
Tue Jul 16 14:27:03 EDT 2013


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


More information about the pacman-dev mailing list