aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.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:30:19 +0000
commit906230a73b3ccfa4afd2a19a6b0aa18cd1d5fa08 (patch)
treee76d9557b248aa859077ce752db3bdbbab7dabb9 /meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch
parent388a6cdef0a993d781141f7c375a198f4c4ab808 (diff)
downloadopenembedded-core-contrib-906230a73b3ccfa4afd2a19a6b0aa18cd1d5fa08.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. Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch')
-rw-r--r--meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch118
1 files changed, 118 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch b/meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch
new file mode 100644
index 0000000000..9f62cbbe69
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch
@@ -0,0 +1,118 @@
+From 33be9052315cc4ec8e929fa238e1f0cc0161ad07 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 21:15:28 -0800
+Subject: [PATCH] src/basic/missing.h: check for missing strndupa
+
+include missing.h for definition of strndupa
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 1 +
+ src/basic/missing.h | 11 +++++++++++
+ src/basic/mkdir.c | 1 +
+ src/basic/parse-util.c | 1 +
+ src/basic/procfs-util.c | 1 +
+ src/shared/pager.c | 1 +
+ src/shared/uid-range.c | 1 +
+ 7 files changed, 17 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 4eabaafe8..12811b3f3 100644
+--- a/meson.build
++++ b/meson.build
+@@ -525,6 +525,7 @@ foreach ident : [
+ ['bpf', '''#include <sys/syscall.h>
+ #include <unistd.h>'''],
+ ['explicit_bzero' , '''#include <string.h>'''],
++ ['strndupa' , '''#include <string.h>'''],
+ ]
+
+ have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 84d6d9167..07a8c8364 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -1187,6 +1187,17 @@ struct input_mask {
+ typedef int32_t key_serial_t;
+ #endif
+
++#if ! HAVE_STRNDUPA
++#define strndupa(s, n) \
++ ({ \
++ const char *__old = (s); \
++ size_t __len = strnlen(__old, (n)); \
++ char *__new = (char *)alloca(__len + 1); \
++ __new[__len] = '\0'; \
++ (char *)memcpy(__new, __old, __len); \
++ })
++#endif
++
+ #ifndef KEYCTL_JOIN_SESSION_KEYRING
+ #define KEYCTL_JOIN_SESSION_KEYRING 1
+ #endif
+diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
+index de4746c86..d51518a5a 100644
+--- a/src/basic/mkdir.c
++++ b/src/basic/mkdir.c
+@@ -30,6 +30,7 @@
+ #include "path-util.h"
+ #include "stat-util.h"
+ #include "user-util.h"
++#include "missing.h"
+
+ int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, bool follow_symlink, mkdir_func_t _mkdir) {
+ struct stat st;
+diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
+index 2c22753de..97533721d 100644
+--- a/src/basic/parse-util.c
++++ b/src/basic/parse-util.c
+@@ -33,6 +33,7 @@
+ #include "parse-util.h"
+ #include "process-util.h"
+ #include "string-util.h"
++#include "missing.h"
+
+ int parse_boolean(const char *v) {
+ assert(v);
+diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c
+index 9bb42cc7b..23bbd9e67 100644
+--- a/src/basic/procfs-util.c
++++ b/src/basic/procfs-util.c
+@@ -9,6 +9,7 @@
+ #include "procfs-util.h"
+ #include "stdio-util.h"
+ #include "string-util.h"
++#include "missing.h"
+
+ int procfs_tasks_get_limit(uint64_t *ret) {
+ _cleanup_free_ char *value = NULL;
+diff --git a/src/shared/pager.c b/src/shared/pager.c
+index 75db3c985..84f06bf7d 100644
+--- a/src/shared/pager.c
++++ b/src/shared/pager.c
+@@ -39,6 +39,7 @@
+ #include "string-util.h"
+ #include "strv.h"
+ #include "terminal-util.h"
++#include "missing.h"
+
+ static pid_t pager_pid = 0;
+
+diff --git a/src/shared/uid-range.c b/src/shared/uid-range.c
+index c38b7cc98..8ec6bf08d 100644
+--- a/src/shared/uid-range.c
++++ b/src/shared/uid-range.c
+@@ -25,6 +25,7 @@
+ #include "macro.h"
+ #include "uid-range.h"
+ #include "user-util.h"
++#include "missing.h"
+
+ static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) {
+ assert(range);
+--
+2.13.0
+