summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-03-12 14:35:45 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-20 09:59:33 +0000
commit40db00818e3b1cce8aa85ee30f3081ae9a5f8e66 (patch)
treedb55cb6251e3e268cf29764fe71aae4e27517b3a /meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch
parent0748f2c4d5c773d1cefa80df97c126194c86b78e (diff)
downloadpoky-40db00818e3b1cce8aa85ee30f3081ae9a5f8e66.tar.gz
systemd: upgrade to 237
Upgrade systemd to 237. Note that this version has dropped autotools support. The following patches are rebased: 0004-Use-getenv-when-secure-versions-are-not-available.patch 0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch 0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch 0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch 0018-check-for-uchar.h-in-configure.patch 0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch 0001-add-fallback-parse_printf_format-implementation.patch 0002-src-basic-missing.h-check-for-missing-strndupa.patch 0007-check-for-missing-canonicalize_file_name.patch 0008-Do-not-enable-nss-tests.patch 0010-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch 0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch The following backported patches are dropped: 0001-core-evaluate-presets-after-generators-have-run-6526.patch 0001-main-skip-many-initialization-steps-when-running-in-.patch 0001-meson-update-header-file-to-detect-memfd_create.patch 0003-fileio-include-sys-mman.h.patch The following patch is dropped as autotools support is dropped: 0002-configure.ac-Check-if-memfd_create-is-already-define.patch The following patches are newly added to fix problems: 0027-remove-nobody-user-group-checking.patch 0028-add-missing-FTW_-macros-for-musl.patch 0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch 0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch Other changes are mostly autotools/meson related. This new version has dropped ptest support, as there's no easy way to do this in the framework of meson. (From OE-Core rev: 906230a73b3ccfa4afd2a19a6b0aa18cd1d5fa08) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch')
-rw-r--r--meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch89
1 files changed, 89 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch b/meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch
new file mode 100644
index 0000000000..46d75ada75
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch
@@ -0,0 +1,89 @@
1From 88c48ea84db6fda19dfaeb64545fccf8fa0525ec Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 27 Oct 2017 13:00:41 -0700
4Subject: [PATCH 26/31] Use uintmax_t for handling rlim_t
5
6PRIu{32,64} is not right format to represent rlim_t type
7therefore use %ju and typecast the rlim_t variables to
8uintmax_t.
9
10Fixes portablility errors like
11
12execute.c:3446:36: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=]
13| fprintf(f, "%s%s: " RLIM_FMT "\n",
14| ^~~~~~~~
15| prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
16| ~~~~~~~~~~~~~~~~~~~~~~
17
18Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/7199]
19
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21---
22 src/basic/format-util.h | 8 --------
23 src/basic/rlimit-util.c | 8 ++++----
24 src/core/execute.c | 8 ++++----
25 3 files changed, 8 insertions(+), 16 deletions(-)
26
27diff --git a/src/basic/format-util.h b/src/basic/format-util.h
28index d9a78f781..9a1bc21d7 100644
29--- a/src/basic/format-util.h
30+++ b/src/basic/format-util.h
31@@ -61,14 +61,6 @@
32 # define PRI_TIMEX "li"
33 #endif
34
35-#if SIZEOF_RLIM_T == 8
36-# define RLIM_FMT "%" PRIu64
37-#elif SIZEOF_RLIM_T == 4
38-# define RLIM_FMT "%" PRIu32
39-#else
40-# error Unknown rlim_t size
41-#endif
42-
43 #if SIZEOF_DEV_T == 8
44 # define DEV_FMT "%" PRIu64
45 #elif SIZEOF_DEV_T == 4
46diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
47index 00648211d..df3d9ecc1 100644
48--- a/src/basic/rlimit-util.c
49+++ b/src/basic/rlimit-util.c
50@@ -286,13 +286,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) {
51 if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY)
52 s = strdup("infinity");
53 else if (rl->rlim_cur >= RLIM_INFINITY)
54- (void) asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max);
55+ (void) asprintf(&s, "infinity:%ju", (uintmax_t)rl->rlim_max);
56 else if (rl->rlim_max >= RLIM_INFINITY)
57- (void) asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur);
58+ (void) asprintf(&s, "%ju:infinity", (uintmax_t)rl->rlim_cur);
59 else if (rl->rlim_cur == rl->rlim_max)
60- (void) asprintf(&s, RLIM_FMT, rl->rlim_cur);
61+ (void) asprintf(&s, "%ju", (uintmax_t)rl->rlim_cur);
62 else
63- (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max);
64+ (void) asprintf(&s, "%ju:%ju", (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max);
65
66 if (!s)
67 return -ENOMEM;
68diff --git a/src/core/execute.c b/src/core/execute.c
69index 0df3971df..aabdddb68 100644
70--- a/src/core/execute.c
71+++ b/src/core/execute.c
72@@ -3991,10 +3991,10 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
73
74 for (i = 0; i < RLIM_NLIMITS; i++)
75 if (c->rlimit[i]) {
76- fprintf(f, "%s%s: " RLIM_FMT "\n",
77- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
78- fprintf(f, "%s%sSoft: " RLIM_FMT "\n",
79- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur);
80+ fprintf(f, "%s%s: %ju\n",
81+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max);
82+ fprintf(f, "%s%sSoft: %ju\n",
83+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur);
84 }
85
86 if (c->ioprio_set) {
87--
882.13.0
89