summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-06-07 02:19:05 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-06-07 09:52:51 +0300
commit58ece20278fdc8730a017a1744afe717ccb771de (patch)
tree269dae08d56d6d387e21fca4019565c320b80709 /include
parentf507ec5e6be795fcb67e472ce98fd084ac9bb1d1 (diff)
libmtd: use O_CLOEXEC
Not strictly necessary, but this is good library behavior and should carry no runtime overhead. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'include')
-rw-r--r--include/common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index c37660c..7ea282c 100644
--- a/include/common.h
+++ b/include/common.h
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
+#include <fcntl.h>
#include <errno.h>
#ifndef PROGRAM_NAME
@@ -42,6 +43,10 @@ extern "C" {
#define min(a, b) MIN(a, b) /* glue for linux kernel source */
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
/* Verbose messages */
#define bareverbose(verbose, fmt, ...) do { \
if (verbose) \