diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch | 68 |
1 files changed, 27 insertions, 41 deletions
diff --git a/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch b/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch index fa8217e3da..d93f630752 100644 --- a/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch +++ b/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch @@ -1,55 +1,51 @@ -From 7bcf3b166694090497a0acd2c5299e4e04fcc9b6 Mon Sep 17 00:00:00 2001 -From: Chen Qi <Qi.Chen@windriver.com> -Date: Mon, 25 Feb 2019 14:04:21 +0800 -Subject: [PATCH 04/24] add fallback parse_printf_format implementation +From 3e0df2c22bfd37bc62bf09a01ec498e40d3599de Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex.kanavin@gmail.com> +Date: Sat, 22 May 2021 20:26:24 +0200 +Subject: [PATCH] add fallback parse_printf_format implementation Upstream-Status: Inappropriate [musl specific] Signed-off-by: Emil Renner Berthing <systemd@esmil.dk> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +[rebased for systemd 243] +Signed-off-by: Scott Murray <scott.murray@konsulko.com> + --- - meson.build | 1 + - src/basic/meson.build | 5 + - src/basic/parse-printf-format.c | 273 ++++++++++++++++++++++++++++++++++++++++ - src/basic/parse-printf-format.h | 57 +++++++++ - src/basic/stdio-util.h | 2 +- - src/journal/journal-send.c | 2 +- + meson.build | 1 + + src/basic/meson.build | 5 + + src/basic/parse-printf-format.c | 273 +++++++++++++++++++++++ + src/basic/parse-printf-format.h | 57 +++++ + src/basic/stdio-util.h | 2 +- + src/libsystemd/sd-journal/journal-send.c | 2 +- 6 files changed, 338 insertions(+), 2 deletions(-) create mode 100644 src/basic/parse-printf-format.c create mode 100644 src/basic/parse-printf-format.h -diff --git a/meson.build b/meson.build -index 79195c9748..0bffbf29c5 100644 --- a/meson.build +++ b/meson.build -@@ -685,6 +685,7 @@ foreach header : ['crypt.h', +@@ -686,6 +686,7 @@ endif + foreach header : ['crypt.h', 'linux/memfd.h', 'linux/vm_sockets.h', - 'linux/can/vxcan.h', + 'printf.h', 'sys/auxv.h', 'valgrind/memcheck.h', 'valgrind/valgrind.h', -diff --git a/src/basic/meson.build b/src/basic/meson.build -index 91e0df3d2f..a732b554da 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build -@@ -298,6 +298,11 @@ foreach item : [['af', af_list_txt, 'af', ''], - endforeach +@@ -335,6 +335,11 @@ endforeach basic_sources += generated_gperf_headers -+ + +if conf.get('HAVE_PRINTF_H') != 1 + basic_sources += [files('parse-printf-format.c')] +endif + - basic_gcrypt_sources = files( - 'gcrypt-util.c', - 'gcrypt-util.h') -diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c -new file mode 100644 -index 0000000000..49437e5445 ++ + ############################################################ + + arch_list = [ --- /dev/null +++ b/src/basic/parse-printf-format.c @@ -0,0 +1,273 @@ @@ -326,9 +322,6 @@ index 0000000000..49437e5445 + + return last; +} -diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h -new file mode 100644 -index 0000000000..47be7522d7 --- /dev/null +++ b/src/basic/parse-printf-format.h @@ -0,0 +1,57 @@ @@ -389,12 +382,10 @@ index 0000000000..47be7522d7 +size_t parse_printf_format(const char *fmt, size_t n, int *types); + +#endif /* HAVE_PRINTF_H */ -diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h -index c3b9448d4f..2937aa13b1 100644 --- a/src/basic/stdio-util.h +++ b/src/basic/stdio-util.h @@ -1,13 +1,13 @@ - /* SPDX-License-Identifier: LGPL-2.1+ */ + /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include <printf.h> @@ -406,20 +397,18 @@ index c3b9448d4f..2937aa13b1 100644 #include "memory-util.h" +#include "parse-printf-format.h" - #define snprintf_ok(buf, len, fmt, ...) \ - ((size_t) snprintf(buf, len, fmt, __VA_ARGS__) < (len)) -diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c -index 5ef11fa1a4..6384ab620c 100644 ---- a/src/journal/journal-send.c -+++ b/src/journal/journal-send.c + #define snprintf_ok(buf, len, fmt, ...) \ + ({ \ +--- a/src/libsystemd/sd-journal/journal-send.c ++++ b/src/libsystemd/sd-journal/journal-send.c @@ -2,7 +2,6 @@ #include <errno.h> #include <fcntl.h> -#include <printf.h> #include <stddef.h> - #include <sys/socket.h> #include <sys/un.h> + #include <unistd.h> @@ -21,6 +20,7 @@ #include "stdio-util.h" #include "string-util.h" @@ -428,6 +417,3 @@ index 5ef11fa1a4..6384ab620c 100644 #define SNDBUF_SIZE (8*1024*1024) --- -2.11.0 - |