diff options
author | mingli.yu@windriver.com <mingli.yu@windriver.com> | 2016-07-22 16:19:43 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2016-07-29 11:00:58 +0200 |
commit | 9bf3e362e769e5d600fbb621ac0c1edd89529acf (patch) | |
tree | 620ea3fad8938585fab9d4528aaad72a75f36707 /meta-oe/recipes-extended/collectd | |
parent | 5ed0925c2a85b14e7a03fddf5720ddf0eabbf1d4 (diff) | |
download | meta-openembedded-9bf3e362e769e5d600fbb621ac0c1edd89529acf.tar.gz |
collectd: replace deprecated readdir_r() with readdir()
* Replace the usage of readdir_r() with readdir()
to address a compilation error under glibc 2.24
due to the deprecation of readdir_r
| ../../collectd-5.5.0/src/vserver.c: In function 'vserver_read':
| ../../collectd-5.5.0/src/vserver.c:167:3: error: 'readdir_r' is deprecated [-Werror=deprecated-declarations]
| status = readdir_r (proc, (struct dirent *) dirent_buffer, &dent);
| ^~~~~~
| In file included from /buildarea4/myu2/build/prj_test_20160722/bitbake_build/tmp/sysroots/qemux86/usr/include/features.h:368:0,
| from /buildarea4/myu2/build/prj_test_20160722/bitbake_build/tmp/sysroots/qemux86/usr/include/stdio.h:27,
| from ../../collectd-5.5.0/src/daemon/collectd.h:34,
| from ../../collectd-5.5.0/src/vserver.c:29:
| /buildarea4/myu2/build/prj_test_20160722/bitbake_build/tmp/sysroots/qemux86/usr/include/dirent.h:189:12: note: declared here
| extern int __REDIRECT (readdir_r,
| ^
[1]https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7584a3f96de88d5eefe5d6c634515278cbfbf052;hp=8d9c92017d85f23ba6a2b3614b2f2bcf1820d6f0
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended/collectd')
-rw-r--r-- | meta-oe/recipes-extended/collectd/collectd/0001-collectd-replace-deprecated-readdir_r-with-readdir.patch | 66 | ||||
-rw-r--r-- | meta-oe/recipes-extended/collectd/collectd_5.5.0.bb | 4 |
2 files changed, 67 insertions, 3 deletions
diff --git a/meta-oe/recipes-extended/collectd/collectd/0001-collectd-replace-deprecated-readdir_r-with-readdir.patch b/meta-oe/recipes-extended/collectd/collectd/0001-collectd-replace-deprecated-readdir_r-with-readdir.patch new file mode 100644 index 000000000..f3d53f26e --- /dev/null +++ b/meta-oe/recipes-extended/collectd/collectd/0001-collectd-replace-deprecated-readdir_r-with-readdir.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | Subject: [PATCH] collectd: replace deprecated readdir_r() with readdir() | ||
2 | |||
3 | * Replace the usage of readdir_r() with readdir() | ||
4 | to address a compilation error under glibc 2.24 | ||
5 | due to the deprecation of readdir_r | ||
6 | |||
7 | | ../../collectd-5.5.0/src/vserver.c: In function 'vserver_read': | ||
8 | | ../../collectd-5.5.0/src/vserver.c:167:3: error: 'readdir_r' is deprecated [-Werror=deprecated-declarations] | ||
9 | | status = readdir_r (proc, (struct dirent *) dirent_buffer, &dent); | ||
10 | | ^~~~~~ | ||
11 | | In file included from /buildarea4/myu2/build/prj_test_20160722/bitbake_build/tmp/sysroots/qemux86/usr/include/features.h:368:0, | ||
12 | | from /buildarea4/myu2/build/prj_test_20160722/bitbake_build/tmp/sysroots/qemux86/usr/include/stdio.h:27, | ||
13 | | from ../../collectd-5.5.0/src/daemon/collectd.h:34, | ||
14 | | from ../../collectd-5.5.0/src/vserver.c:29: | ||
15 | | /buildarea4/myu2/build/prj_test_20160722/bitbake_build/tmp/sysroots/qemux86/usr/include/dirent.h:189:12: note: declared here | ||
16 | | extern int __REDIRECT (readdir_r, | ||
17 | | ^ | ||
18 | |||
19 | [1]https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7584a3f96de88d5eefe5d6c634515278cbfbf052;hp=8d9c92017d85f23ba6a2b3614b2f2bcf1820d6f0 | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | |||
23 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
24 | --- | ||
25 | src/vserver.c | 15 ++++----------- | ||
26 | 1 file changed, 4 insertions(+), 11 deletions(-) | ||
27 | |||
28 | diff --git a/src/vserver.c b/src/vserver.c | ||
29 | index bd2e867..2e4e715 100644 | ||
30 | --- a/src/vserver.c | ||
31 | +++ b/src/vserver.c | ||
32 | @@ -131,15 +131,8 @@ static derive_t vserver_get_sock_bytes(const char *s) | ||
33 | |||
34 | static int vserver_read (void) | ||
35 | { | ||
36 | -#if NAME_MAX < 1024 | ||
37 | -# define DIRENT_BUFFER_SIZE (sizeof (struct dirent) + 1024 + 1) | ||
38 | -#else | ||
39 | -# define DIRENT_BUFFER_SIZE (sizeof (struct dirent) + NAME_MAX + 1) | ||
40 | -#endif | ||
41 | - | ||
42 | DIR *proc; | ||
43 | - struct dirent *dent; /* 42 */ | ||
44 | - char dirent_buffer[DIRENT_BUFFER_SIZE]; | ||
45 | + struct dirent *dent = NULL; /* 42 */ | ||
46 | |||
47 | errno = 0; | ||
48 | proc = opendir (PROCDIR); | ||
49 | @@ -164,11 +157,11 @@ static int vserver_read (void) | ||
50 | |||
51 | int status; | ||
52 | |||
53 | - status = readdir_r (proc, (struct dirent *) dirent_buffer, &dent); | ||
54 | - if (status != 0) | ||
55 | + dent = readdir (proc); | ||
56 | + if (dent == NULL && errno != 0) | ||
57 | { | ||
58 | char errbuf[4096]; | ||
59 | - ERROR ("vserver plugin: readdir_r failed: %s", | ||
60 | + ERROR ("vserver plugin: readdir failed: %s", | ||
61 | sstrerror (errno, errbuf, sizeof (errbuf))); | ||
62 | closedir (proc); | ||
63 | return (-1); | ||
64 | -- | ||
65 | 2.8.2 | ||
66 | |||
diff --git a/meta-oe/recipes-extended/collectd/collectd_5.5.0.bb b/meta-oe/recipes-extended/collectd/collectd_5.5.0.bb index b95f6e35f..9ec76c8a0 100644 --- a/meta-oe/recipes-extended/collectd/collectd_5.5.0.bb +++ b/meta-oe/recipes-extended/collectd/collectd_5.5.0.bb | |||
@@ -12,6 +12,7 @@ SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \ | |||
12 | file://collectd.init \ | 12 | file://collectd.init \ |
13 | file://collectd.service \ | 13 | file://collectd.service \ |
14 | file://0001-conditionally-check-libvirt.patch \ | 14 | file://0001-conditionally-check-libvirt.patch \ |
15 | file://0001-collectd-replace-deprecated-readdir_r-with-readdir.patch \ | ||
15 | " | 16 | " |
16 | SRC_URI[md5sum] = "c39305ef5514b44238b0d31f77e29e6a" | 17 | SRC_URI[md5sum] = "c39305ef5514b44238b0d31f77e29e6a" |
17 | SRC_URI[sha256sum] = "847684cf5c10de1dc34145078af3fcf6e0d168ba98c14f1343b1062a4b569e88" | 18 | SRC_URI[sha256sum] = "847684cf5c10de1dc34145078af3fcf6e0d168ba98c14f1343b1062a4b569e88" |
@@ -82,6 +83,3 @@ INITSCRIPT_PARAMS = "defaults" | |||
82 | # threshold.so load.so are also provided by gegl | 83 | # threshold.so load.so are also provided by gegl |
83 | # disk.so is also provided by libgphoto2-camlibs | 84 | # disk.so is also provided by libgphoto2-camlibs |
84 | PRIVATE_LIBS = "threshold.so load.so disk.so" | 85 | PRIVATE_LIBS = "threshold.so load.so disk.so" |
85 | |||
86 | # http://errors.yoctoproject.org/Errors/Details/68629/ | ||
87 | PNBLACKLIST[collectd] ?= "BROKEN: fails to build with glibc-2.24" | ||