aboutsummaryrefslogtreecommitdiff
path: root/utils/acl/patches/103-chacl-Use-portable-version-of-dirent-and-readdir.patch
blob: 66bd86c64ed432fc74e49d10e2c0c5bafea90d85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 2b42f64737adf6a2ddd491213580d6e9cdd2f5af Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 10 Nov 2022 18:04:15 -0800
Subject: [PATCH] chacl: Use portable version of dirent and readdir

Using 64bit versions on 32bit architectures should be enabled with
--enable-largefile, this makes it portable across musl and glibc

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 tools/chacl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/tools/chacl.c
+++ b/tools/chacl.c
@@ -320,7 +320,7 @@ walk_dir(acl_t acl, acl_t dacl, const ch
 {
 	int failed = 0;
 	DIR *dir;
-	struct dirent64 *d;
+	struct dirent *d;
 	char *name;
 
 	if ((dir = opendir(fname)) == NULL) {
@@ -332,7 +332,7 @@ walk_dir(acl_t acl, acl_t dacl, const ch
 		return(0);	/* got a file, not an error */
 	}
 
-	while ((d = readdir64(dir)) != NULL) {
+	while ((d = readdir(dir)) != NULL) {
 		/* skip "." and ".." entries */
 		if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
 			continue;