summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch
diff options
context:
space:
mode:
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.patch58
1 files changed, 22 insertions, 36 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 0dea933270..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,6 +1,6 @@
-From 8af168cefca01f8f2da336f1c82620c284dc74f2 Mon Sep 17 00:00:00 2001
-From: Chen Qi <Qi.Chen@windriver.com>
-Date: Mon, 25 Feb 2019 14:04:21 +0800
+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]
@@ -12,21 +12,19 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
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 fc216d22da24..a25996803d64 100644
--- a/meson.build
+++ b/meson.build
-@@ -640,6 +640,7 @@ endif
+@@ -686,6 +686,7 @@ endif
foreach header : ['crypt.h',
'linux/memfd.h',
'linux/vm_sockets.h',
@@ -34,25 +32,20 @@ index fc216d22da24..a25996803d64 100644
'sys/auxv.h',
'valgrind/memcheck.h',
'valgrind/valgrind.h',
-diff --git a/src/basic/meson.build b/src/basic/meson.build
-index ccb22e159505..25c77ea6bc0e 100644
--- a/src/basic/meson.build
+++ b/src/basic/meson.build
-@@ -313,6 +313,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 000000000000..49437e544540
++
+ ############################################################
+
+ arch_list = [
--- /dev/null
+++ b/src/basic/parse-printf-format.c
@@ -0,0 +1,273 @@
@@ -329,9 +322,6 @@ index 000000000000..49437e544540
+
+ return last;
+}
-diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h
-new file mode 100644
-index 000000000000..47be7522d7fa
--- /dev/null
+++ b/src/basic/parse-printf-format.h
@@ -0,0 +1,57 @@
@@ -392,12 +382,10 @@ index 000000000000..47be7522d7fa
+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 c3b9448d4f4f..2937aa13b178 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>
@@ -409,12 +397,10 @@ index c3b9448d4f4f..2937aa13b178 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 912ecef73cce..43ed756bda53 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>
@@ -423,7 +409,7 @@ index 912ecef73cce..43ed756bda53 100644
#include <stddef.h>
#include <sys/un.h>
#include <unistd.h>
-@@ -20,6 +19,7 @@
+@@ -21,6 +20,7 @@
#include "stdio-util.h"
#include "string-util.h"
#include "tmpfile-util.h"