]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
systemd: Correct 0001-pass-correct-parameters-to-getdents64.patch
authorJiaqing Zhao <jiaqing.zhao@linux.intel.com>
Tue, 7 Jun 2022 02:49:23 +0000 (10:49 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 8 Jun 2022 20:52:09 +0000 (21:52 +0100)
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.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/systemd/systemd/0001-pass-correct-parameters-to-getdents64.patch

index 028f50b243160fada67a81b7fbd3f7e881fa2ef6..9ebff9825ad339626a6bef9b6d6210c6a3973127 100644 (file)
@@ -1,4 +1,4 @@
-From 8c8899b4641125cfe8e7baee32e5c5f452545d2c Mon Sep 17 00:00:00 2001
+From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Fri, 21 Jan 2022 15:15:11 -0800
 Subject: [PATCH] pass correct parameters to getdents64
@@ -12,16 +12,16 @@ Fixes
         n = getdents64(fd, &buffer, sizeof(buffer));
                            ^~~~~~~
 
-Upstream-Status: Pending
+Upstream-Status: Inappropriate [musl specific]
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
+Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
 ---
  src/basic/recurse-dir.c | 2 +-
  src/basic/stat-util.c   | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
-index efa1797b7b..797285e3be 100644
+index efa1797b7b..03ff10ebe9 100644
 --- a/src/basic/recurse-dir.c
 +++ b/src/basic/recurse-dir.c
 @@ -54,7 +54,7 @@ int readdir_all(int dir_fd,
@@ -29,7 +29,7 @@ index efa1797b7b..797285e3be 100644
                  assert(bs > de->buffer_size);
  
 -                n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
-+                n = getdents64(dir_fd, de->buffer + de->buffer_size, bs - de->buffer_size);
++                n = getdents64(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
                  if (n < 0)
                          return -errno;
                  if (n == 0)
@@ -46,3 +46,6 @@ index c2269844f8..7cd6c7fa42 100644
          if (n < 0)
                  return -errno;
  
+-- 
+2.34.1
+