From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- ...-XSI-compliant-strerror_r-from-GNU-specif.patch | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 external/meta-openembedded/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd-243/0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch (limited to 'external/meta-openembedded/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd-243/0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch') diff --git a/external/meta-openembedded/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd-243/0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch b/external/meta-openembedded/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd-243/0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch new file mode 100644 index 00000000..59017729 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-core/sdbus-c++/sdbus-c++-libsystemd-243/0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch @@ -0,0 +1,62 @@ +From fffb2810611b4a26f5c6c0958093b5b3b7d4cd99 Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Tue, 10 Jul 2018 15:40:17 +0800 +Subject: [PATCH 18/24] distinguish XSI-compliant strerror_r from GNU-specifi + strerror_r + +XSI-compliant strerror_r and GNU-specifi strerror_r are different. + + int strerror_r(int errnum, char *buf, size_t buflen); + /* XSI-compliant */ + + char *strerror_r(int errnum, char *buf, size_t buflen); + /* GNU-specific */ + +We need to distinguish between them. Otherwise, we'll get an int value +assigned to (char *) variable, resulting in segment fault. + +Upstream-Status: Inappropriate [musl specific] + +Signed-off-by: Chen Qi +--- + src/journal/journal-send.c | 5 +++++ + src/libsystemd/sd-bus/bus-error.c | 5 +++++ + 2 files changed, 10 insertions(+) + +diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c +index 3fea912..4f1e592 100644 +--- a/src/journal/journal-send.c ++++ b/src/journal/journal-send.c +@@ -337,7 +337,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove + char* j; + + errno = 0; ++#ifndef __GLIBC__ ++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k); ++ j = buffer + 8 + k; ++#else + j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k); ++#endif + if (errno == 0) { + char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1]; + +diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c +index dc95237..bdda30f 100644 +--- a/src/libsystemd/sd-bus/bus-error.c ++++ b/src/libsystemd/sd-bus/bus-error.c +@@ -379,7 +379,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) { + return; + + errno = 0; ++#ifndef __GLIBC__ ++ strerror_r(error, m, k); ++ x = m; ++#else + x = strerror_r(error, m, k); ++#endif + if (errno == ERANGE || strlen(x) >= k - 1) { + free(m); + k *= 2; +-- +2.7.4 + -- cgit 1.2.3-korg