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 | 75 |
1 files changed, 31 insertions, 44 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 7652a2d8cc..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 582af7ec13131dfcc620ed81de7b211914c4cb03 Mon Sep 17 00:00:00 2001 -From: Chen Qi <Qi.Chen@windriver.com> -Date: Fri, 29 Jun 2018 13:43:49 +0800 -Subject: [PATCH 04/19] 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 e045b9224..8c16bc979 100644 --- a/meson.build +++ b/meson.build -@@ -598,6 +598,7 @@ foreach header : ['crypt.h', - 'linux/btrfs.h', +@@ -686,6 +686,7 @@ endif + foreach header : ['crypt.h', 'linux/memfd.h', 'linux/vm_sockets.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 31625b178..0c27528e7 100644 --- a/src/basic/meson.build +++ b/src/basic/meson.build -@@ -302,6 +302,11 @@ foreach item : [['af', af_list_txt, 'af', ''], - endforeach +@@ -335,6 +335,11 @@ endforeach + + basic_sources += generated_gperf_headers - basic_sources += [missing_h] + 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 000000000..49437e544 ++ + ############################################################ + + arch_list = [ --- /dev/null +++ b/src/basic/parse-printf-format.c @@ -0,0 +1,273 @@ @@ -326,9 +322,6 @@ index 000000000..49437e544 + + return last; +} -diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h -new file mode 100644 -index 000000000..47be7522d --- /dev/null +++ b/src/basic/parse-printf-format.h @@ -0,0 +1,57 @@ @@ -389,12 +382,10 @@ index 000000000..47be7522d +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 73c03274c..30192cd71 100644 --- a/src/basic/stdio-util.h +++ b/src/basic/stdio-util.h -@@ -1,12 +1,12 @@ - /* SPDX-License-Identifier: LGPL-2.1+ */ +@@ -1,13 +1,13 @@ + /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include <printf.h> @@ -403,30 +394,26 @@ index 73c03274c..30192cd71 100644 #include <sys/types.h> #include "macro.h" + #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 a0621524a..65bcbcd2e 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" - #include "util.h" + #include "tmpfile-util.h" +#include "parse-printf-format.h" #define SNDBUF_SIZE (8*1024*1024) --- -2.11.0 - |