]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include/c: add macro UL_CLOEXECSTR
authorKarel Zak <kzak@redhat.com>
Wed, 3 Apr 2013 14:11:19 +0000 (16:11 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 3 Apr 2013 14:11:19 +0000 (16:11 +0200)
... to make "e" for fopen() portable to systems without O_CLOEXEC.

Signed-off-by: Karel Zak <kzak@redhat.com>
include/c.h

index d2d68c31df3c8ff4382dfd70722ab4167afd1e89..a50e8a5933d0bdca6269b3ae99a36f0f3ae4dca1 100644 (file)
@@ -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