diff options
author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2017-02-22 16:51:16 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-01 23:27:09 +0000 |
commit | a4b618930ac398c054edcc89c14bde3211ba7cb5 (patch) | |
tree | 03ec5689657430034ae82d0103e5b577d7ea2a46 /meta/recipes-support/libnl/libnl/0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch | |
parent | 22c56bd9827c5e0e022e95916852065dc9ecf37c (diff) | |
download | poky-a4b618930ac398c054edcc89c14bde3211ba7cb5.tar.gz |
libnl: update to 3.2.29
Dropped patches are all backports.
(From OE-Core rev: 57ff86881cb8e303c6a177b0ec8e8930dfb3b0a3)
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/libnl/libnl/0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch')
-rw-r--r-- | meta/recipes-support/libnl/libnl/0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/meta/recipes-support/libnl/libnl/0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch b/meta/recipes-support/libnl/libnl/0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch deleted file mode 100644 index a0f5a78092..0000000000 --- a/meta/recipes-support/libnl/libnl/0003-src-switch-to-using-strerror_l-instead-of-strerror_r.patch +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | From 6c2d111177e91184073c44f83d4a6182aaba06d7 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com> | ||
3 | Date: Thu, 25 Aug 2016 13:15:01 +0100 | ||
4 | Subject: [PATCH 3/3] src: switch to using strerror_l() instead of strerror_r() | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | glibc provides two versions of strerror_r(), which | ||
10 | can be chosen between using feature test macros | ||
11 | _GNU_SOURCE and _POSIX_C_SOURCE. libnl is built using | ||
12 | the former, hence we get the glibc special version, | ||
13 | and all code so far has been written for this. | ||
14 | |||
15 | Other C libraries like musl on the other hand only try | ||
16 | to be posix compliant, and only ever provide the posix | ||
17 | version of strerror_r(), which has a different signature. | ||
18 | |||
19 | Uses in libnl hence generally cause printf() of an *int* | ||
20 | with a *string format* specifier for that reason. | ||
21 | |||
22 | Additionally, strerror_r() has been deprecated: | ||
23 | http://austingroupbugs.net/view.php?id=655 | ||
24 | |||
25 | Switch to using strerror_l(). | ||
26 | |||
27 | Signed-off-by: André Draszik <adraszik@tycoint.com> | ||
28 | Reviewed-by: Stephane Ayotte <sayotte@tycoint.com> | ||
29 | Signed-off-by: Thomas Haller <thaller@redhat.com> | ||
30 | --- | ||
31 | Upstream-Status: Backport https://github.com/thom311/libnl/commit/6c2d111177e91184073c44f83d4a6182aaba06d7 | ||
32 | src/lib/utils.c | 20 +++++++++++++++++--- | ||
33 | 1 file changed, 17 insertions(+), 3 deletions(-) | ||
34 | |||
35 | diff --git a/src/lib/utils.c b/src/lib/utils.c | ||
36 | index 467aaed..5878f27 100644 | ||
37 | --- a/src/lib/utils.c | ||
38 | +++ b/src/lib/utils.c | ||
39 | @@ -22,6 +22,7 @@ | ||
40 | */ | ||
41 | |||
42 | #include <netlink/cli/utils.h> | ||
43 | +#include <locale.h> | ||
44 | |||
45 | /** | ||
46 | * Parse a text based 32 bit unsigned integer argument | ||
47 | @@ -70,7 +71,6 @@ void nl_cli_print_version(void) | ||
48 | void nl_cli_fatal(int err, const char *fmt, ...) | ||
49 | { | ||
50 | va_list ap; | ||
51 | - char buf[256]; | ||
52 | |||
53 | fprintf(stderr, "Error: "); | ||
54 | |||
55 | @@ -79,8 +79,22 @@ void nl_cli_fatal(int err, const char *fmt, ...) | ||
56 | vfprintf(stderr, fmt, ap); | ||
57 | va_end(ap); | ||
58 | fprintf(stderr, "\n"); | ||
59 | - } else | ||
60 | - fprintf(stderr, "%s\n", strerror_r(err, buf, sizeof(buf))); | ||
61 | + } else { | ||
62 | + char *buf; | ||
63 | + locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0); | ||
64 | + if (loc == (locale_t)0) { | ||
65 | + if (errno == ENOENT) | ||
66 | + loc = newlocale(LC_MESSAGES_MASK, | ||
67 | + "POSIX", (locale_t)0); | ||
68 | + if (loc == (locale_t)0) | ||
69 | + buf = "newlocale() failed"; | ||
70 | + } | ||
71 | + if (loc != (locale_t)0) | ||
72 | + buf = strerror_l(err, loc); | ||
73 | + fprintf(stderr, "%s\n", buf); | ||
74 | + if (loc != (locale_t)0) | ||
75 | + freelocale(loc); | ||
76 | + } | ||
77 | |||
78 | exit(abs(err)); | ||
79 | } | ||
80 | -- | ||
81 | 2.9.3 | ||
82 | |||