diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2014-03-28 17:42:41 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-01 23:37:01 +0100 |
commit | ae7a07976fbe7a93dbbd70db3f24a32156319756 (patch) | |
tree | 06ce122c20cdebd8aa77084f40e329a7e341d383 /meta | |
parent | c48aff883aeb28703c03ab9415c1c2c8adc3b9b4 (diff) | |
download | poky-ae7a07976fbe7a93dbbd70db3f24a32156319756.tar.gz |
kmod: fix O_CLOEXEC not supported on old kernel
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.
(From OE-Core rev: 44c441222002ee0177100be0431adf91984e90d5)
Signed-off-by: Ting Liu <b28495@freescale.com>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-kernel/kmod/kmod.inc | 1 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch | 38 |
2 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-kernel/kmod/kmod.inc b/meta/recipes-kernel/kmod/kmod.inc index b7e176c876..47445eb8bf 100644 --- a/meta/recipes-kernel/kmod/kmod.inc +++ b/meta/recipes-kernel/kmod/kmod.inc | |||
@@ -25,6 +25,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \ | |||
25 | file://run-ptest \ | 25 | file://run-ptest \ |
26 | file://ptest.patch \ | 26 | file://ptest.patch \ |
27 | file://avoid_parallel_tests.patch \ | 27 | file://avoid_parallel_tests.patch \ |
28 | file://fix-O_CLOEXEC.patch \ | ||
28 | " | 29 | " |
29 | 30 | ||
30 | S = "${WORKDIR}/git" | 31 | S = "${WORKDIR}/git" |
diff --git a/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch new file mode 100644 index 0000000000..8161d6128d --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From bd43367eee868059770188fd9e9db38520dc6fff Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Wed, 22 Jan 2014 01:06:40 -0500 | ||
4 | Subject: [PATCH] libkmod/libkmod-internal.h: check whether O_CLOEXEC is | ||
5 | defined or not | ||
6 | |||
7 | O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have | ||
8 | it, we need check before use. | ||
9 | |||
10 | This patch is much more like a workaround, since it may need fcntl() use | ||
11 | FD_CLOEXEC to replace. | ||
12 | |||
13 | This problem was reported by "Ting Liu <b28495@freescale.com>" | ||
14 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
15 | |||
16 | Upstream-Status: Pending | ||
17 | --- | ||
18 | libkmod/libkmod-internal.h | 4 ++++ | ||
19 | 1 file changed, 4 insertions(+) | ||
20 | |||
21 | diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h | ||
22 | index 0180124..100b40f 100644 | ||
23 | --- a/libkmod/libkmod-internal.h | ||
24 | +++ b/libkmod/libkmod-internal.h | ||
25 | @@ -9,6 +9,10 @@ | ||
26 | #include "macro.h" | ||
27 | #include "libkmod.h" | ||
28 | |||
29 | +#ifndef O_CLOEXEC | ||
30 | +#define O_CLOEXEC 0 | ||
31 | +#endif | ||
32 | + | ||
33 | static _always_inline_ _printf_format_(2, 3) void | ||
34 | kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {} | ||
35 | |||
36 | -- | ||
37 | 1.7.10.4 | ||
38 | |||