diff options
author | Karel Zak | 2013-04-03 16:11:19 +0200 |
---|---|---|
committer | Karel Zak | 2013-04-03 16:11:19 +0200 |
commit | 2ffad204c0c78009a497b093f9c9bbc148c6ed9a (patch) | |
tree | 3a82def3d5b361e3223a9ed8bdfbdd4f6a168b45 /include/c.h | |
parent | lib/canonicalize: don't use /dev/mapper/<name> if the node does not exist (diff) | |
download | kernel-qcow2-util-linux-2ffad204c0c78009a497b093f9c9bbc148c6ed9a.tar.gz kernel-qcow2-util-linux-2ffad204c0c78009a497b093f9c9bbc148c6ed9a.tar.xz kernel-qcow2-util-linux-2ffad204c0c78009a497b093f9c9bbc148c6ed9a.zip |
include/c: add macro UL_CLOEXECSTR
... to make "e" for fopen() portable to systems without O_CLOEXEC.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/c.h')
-rw-r--r-- | include/c.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/c.h b/include/c.h index d2d68c31d..a50e8a593 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 <fcntl.h> + +#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 |