diff options
author | Jiaqing Zhao <jiaqing.zhao@linux.intel.com> | 2022-06-07 10:49:23 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-06-08 21:52:12 +0100 |
commit | 6c43f2369d9777b8de61944f6f3882b74343c7ad (patch) | |
tree | c81b9ddfb710118d53bc260bd84cabdb65dbcb3a /meta/recipes-core | |
parent | 08fc2a20aaad6773fc149655515f21c62d6e48a5 (diff) | |
download | poky-6c43f2369d9777b8de61944f6f3882b74343c7ad.tar.gz |
systemd: Correct 0001-pass-correct-parameters-to-getdents64.patch
Current patch removes the uint8_t* cast in src/basic/recurse-dir.c:57
to fix musl build, but it changes the value here as pointer arithmetic
is type-depended in C. This patch corrects the behavior by adding an
extra cast to struct dirent*.
Also changes the patch's Upstream-Status to Inappropriate as it's musl-
specific.
(From OE-Core rev: e9e43d7f7488c4da8598759c4882cceeda9d2095)
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0001-pass-correct-parameters-to-getdents64.patch | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-pass-correct-parameters-to-getdents64.patch b/meta/recipes-core/systemd/systemd/0001-pass-correct-parameters-to-getdents64.patch index 028f50b243..9ebff9825a 100644 --- a/meta/recipes-core/systemd/systemd/0001-pass-correct-parameters-to-getdents64.patch +++ b/meta/recipes-core/systemd/systemd/0001-pass-correct-parameters-to-getdents64.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 8c8899b4641125cfe8e7baee32e5c5f452545d2c Mon Sep 17 00:00:00 2001 | 1 | From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Fri, 21 Jan 2022 15:15:11 -0800 | 3 | Date: Fri, 21 Jan 2022 15:15:11 -0800 |
4 | Subject: [PATCH] pass correct parameters to getdents64 | 4 | Subject: [PATCH] pass correct parameters to getdents64 |
@@ -12,16 +12,16 @@ Fixes | |||
12 | n = getdents64(fd, &buffer, sizeof(buffer)); | 12 | n = getdents64(fd, &buffer, sizeof(buffer)); |
13 | ^~~~~~~ | 13 | ^~~~~~~ |
14 | 14 | ||
15 | Upstream-Status: Pending | 15 | Upstream-Status: Inappropriate [musl specific] |
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
17 | 17 | Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com> | |
18 | --- | 18 | --- |
19 | src/basic/recurse-dir.c | 2 +- | 19 | src/basic/recurse-dir.c | 2 +- |
20 | src/basic/stat-util.c | 2 +- | 20 | src/basic/stat-util.c | 2 +- |
21 | 2 files changed, 2 insertions(+), 2 deletions(-) | 21 | 2 files changed, 2 insertions(+), 2 deletions(-) |
22 | 22 | ||
23 | diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c | 23 | diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c |
24 | index efa1797b7b..797285e3be 100644 | 24 | index efa1797b7b..03ff10ebe9 100644 |
25 | --- a/src/basic/recurse-dir.c | 25 | --- a/src/basic/recurse-dir.c |
26 | +++ b/src/basic/recurse-dir.c | 26 | +++ b/src/basic/recurse-dir.c |
27 | @@ -54,7 +54,7 @@ int readdir_all(int dir_fd, | 27 | @@ -54,7 +54,7 @@ int readdir_all(int dir_fd, |
@@ -29,7 +29,7 @@ index efa1797b7b..797285e3be 100644 | |||
29 | assert(bs > de->buffer_size); | 29 | assert(bs > de->buffer_size); |
30 | 30 | ||
31 | - n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size); | 31 | - n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size); |
32 | + n = getdents64(dir_fd, de->buffer + de->buffer_size, bs - de->buffer_size); | 32 | + n = getdents64(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size); |
33 | if (n < 0) | 33 | if (n < 0) |
34 | return -errno; | 34 | return -errno; |
35 | if (n == 0) | 35 | if (n == 0) |
@@ -46,3 +46,6 @@ index c2269844f8..7cd6c7fa42 100644 | |||
46 | if (n < 0) | 46 | if (n < 0) |
47 | return -errno; | 47 | return -errno; |
48 | 48 | ||
49 | -- | ||
50 | 2.34.1 | ||
51 | |||