summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch')
-rw-r--r--meta/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch b/meta/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch
new file mode 100644
index 0000000000..0be817e62d
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0016-pass-correct-parameters-to-getdents64.patch
@@ -0,0 +1,37 @@
1From 0994b59dba9f248ad31cb7087046dc00b72cb4ea Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 21 Jan 2022 15:15:11 -0800
4Subject: [PATCH 16/22] pass correct parameters to getdents64
5
6Fixes
7../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
8 n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
9 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10
11../git/src/basic/stat-util.c:102:28: error: incompatible pointer types passing 'union (unnamed union at ../git/src/basic/stat-util.c:78:9) *' to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]
12 n = getdents64(fd, &buffer, sizeof(buffer));
13 ^~~~~~~
14
15Upstream-Status: Inappropriate [musl specific]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
18---
19 src/basic/recurse-dir.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
23index 5e98b7a5d8..aef065047b 100644
24--- a/src/basic/recurse-dir.c
25+++ b/src/basic/recurse-dir.c
26@@ -55,7 +55,7 @@ int readdir_all(int dir_fd,
27 bs = MIN(MALLOC_SIZEOF_SAFE(de) - offsetof(DirectoryEntries, buffer), (size_t) SSIZE_MAX);
28 assert(bs > de->buffer_size);
29
30- n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
31+ n = getdents64(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
32 if (n < 0)
33 return -errno;
34 if (n == 0)
35--
362.34.1
37