diff options
Diffstat (limited to 'meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0001-always-use-glibc-basename.patch')
-rw-r--r-- | meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0001-always-use-glibc-basename.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0001-always-use-glibc-basename.patch b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0001-always-use-glibc-basename.patch new file mode 100644 index 0000000000..78802e39ab --- /dev/null +++ b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/0001-always-use-glibc-basename.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 2fa94fc7adf05fae46204f4665216c8b019010f3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 5 Jul 2024 23:16:38 -0700 | ||
4 | Subject: [PATCH 1/2] always use glibc basename() | ||
5 | |||
6 | There is a use of basename() which expects it to be GNU version of | ||
7 | basename, which is not available in other libcs e.g. musl on Linux | ||
8 | therefore provide a version for such cases | ||
9 | |||
10 | Upstream-Status: Submitted [https://github.com/kmxz/overlayfs-tools/pull/26] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | main.c | 12 ++++++++++++ | ||
14 | 1 file changed, 12 insertions(+) | ||
15 | |||
16 | diff --git a/main.c b/main.c | ||
17 | index 7b669eb..ea0f5a5 100644 | ||
18 | --- a/main.c | ||
19 | +++ b/main.c | ||
20 | @@ -30,6 +30,18 @@ bool brief; | ||
21 | bool ignore; | ||
22 | extern char *program_name; | ||
23 | |||
24 | +#ifndef __GLIBC__ | ||
25 | +/* | ||
26 | + * GNU basename implementation | ||
27 | + */ | ||
28 | +static const char *__basename(const char *filename) { | ||
29 | + char *p = strrchr(filename, '/'); | ||
30 | + return p ? p + 1 : filename; | ||
31 | +} | ||
32 | + | ||
33 | +#define basename(x) __basename(x) | ||
34 | +#endif | ||
35 | + | ||
36 | void print_help(const char *program) { | ||
37 | printf("Usage: %s command options\n", program); | ||
38 | puts(""); | ||