Thomas De Schampheleire
2014-09-30 07:41:46 UTC
From: Robert Yang <liezhi.yang-***@public.gmane.org>
O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have
it, we need check before use.
This patch is much more like a workaround, since it may need fcntl() use
FD_CLOEXEC to replace.
This problem was reported by "Ting Liu <b28495-***@public.gmane.org>"
[Thomas De Schampheleire <thomas.de.schampheleire-***@public.gmane.org:
- move dummy definition from libkmod-internal.h to missing.h
- update commit title]
---
libkmod/missing.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libkmod/missing.h b/libkmod/missing.h
index 4c0d136..e123e98 100644
--- a/libkmod/missing.h
+++ b/libkmod/missing.h
@@ -19,6 +19,10 @@
# define __NR_finit_module -1
#endif
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
#ifndef HAVE_FINIT_MODULE
#include <errno.h>
O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have
it, we need check before use.
This patch is much more like a workaround, since it may need fcntl() use
FD_CLOEXEC to replace.
This problem was reported by "Ting Liu <b28495-***@public.gmane.org>"
[Thomas De Schampheleire <thomas.de.schampheleire-***@public.gmane.org:
- move dummy definition from libkmod-internal.h to missing.h
- update commit title]
---
libkmod/missing.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libkmod/missing.h b/libkmod/missing.h
index 4c0d136..e123e98 100644
--- a/libkmod/missing.h
+++ b/libkmod/missing.h
@@ -19,6 +19,10 @@
# define __NR_finit_module -1
#endif
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
#ifndef HAVE_FINIT_MODULE
#include <errno.h>
--
1.7.1
1.7.1