[OE-core] [oe-core][PATCH 2/3] kmod-native: Only use O_CLOEXEC if it is defined

Burton, Ross ross.burton at intel.com
Tue Jan 14 10:21:52 UTC 2014


On 14 January 2014 10:17, Robert Yang <liezhi.yang at windriver.com> wrote:
>
> On 01/14/2014 05:49 PM, b28495 at freescale.com wrote:
>>
>> From: Ting Liu <b28495 at freescale.com>
>>
>> O_CLOEXEC is not available on some distro, such as centos 5.x
>>
>
> Hi Ting,
>
> Missing the Upstream-Status here, and for the O_CLOEXEC, how about:
>
> #ifdef O_CLOEXEC
> #define O_RDONLY_O_CLOEXEC      O_RDONLY|O_CLOEXEC
> #else
> #define O_RDONLY_O_CLOEXEC      O_RDONLY
> #endif
>
> or something like this, so you don't have to use the "#ifdef" everywhere.

Or to be even less invasive:

#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif

Have you verified that it's safe to drop O_CLOEXEC and it doesn't need
to be replaced with fnctl(FD_CLOEXEC) calls?

Ross



More information about the Openembedded-core mailing list