From: Karel Zak Date: Wed, 3 Apr 2013 14:11:19 +0000 (+0200) Subject: include/c: add macro UL_CLOEXECSTR X-Git-Tag: v2.23-rc2~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ffad204c0c78009a497b093f9c9bbc148c6ed9a;p=thirdparty%2Futil-linux.git include/c: add macro UL_CLOEXECSTR ... to make "e" for fopen() portable to systems without O_CLOEXEC. Signed-off-by: Karel Zak --- diff --git a/include/c.h b/include/c.h index d2d68c31df..a50e8a5933 100644 --- a/include/c.h +++ b/include/c.h @@ -215,10 +215,18 @@ static inline int dirfd(DIR *d) * Fallback defines for old versions of glibc */ #include + +#ifdef O_CLOEXEC +#define UL_CLOEXECSTR "e" +#else +#define UL_CLOEXECSTR "" +#endif + #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif + #ifndef AI_ADDRCONFIG #define AI_ADDRCONFIG 0x0020 #endif