wok-current view fuse2/stuff/fuse-closefrom-glibc-2-34.patch @ rev 25788

Mass update to fix build with gcc10 and up others packages
author Stanislas Leduc <shann@slitaz.org>
date Tue Sep 30 07:43:04 2025 +0000 (3 weeks ago)
parents
children
line source
1 From ae2352bca9b4e607538412da0cc2a9625cd8b692 Mon Sep 17 00:00:00 2001
2 From: Sam James <sam@gentoo.org>
3 Date: Sat, 24 Jul 2021 22:02:45 +0100
4 Subject: [PATCH] util/ulockmgr_server.c: conditionally define closefrom (fix
5 glibc-2.34+)
7 closefrom(3) has joined us in glibc-land from *BSD and Solaris. Since
8 it's available in glibc 2.34+, we want to detect it and only define our
9 fallback if the libc doesn't provide it.
11 Bug: https://bugs.gentoo.org/803923
12 Signed-off-by: Sam James <sam@gentoo.org>
13 ---
14 configure.ac | 1 +
15 util/ulockmgr_server.c | 6 ++++++
16 2 files changed, 7 insertions(+)
18 diff --git a/configure.ac b/configure.ac
19 index 9946a0efa..a2d481aa9 100644
20 --- a/configure.ac
21 +++ b/configure.ac
22 @@ -55,6 +55,7 @@ fi
24 AC_CHECK_FUNCS([fork setxattr fdatasync splice vmsplice utimensat])
25 AC_CHECK_FUNCS([posix_fallocate])
26 +AC_CHECK_FUNCS([closefrom])
27 AC_CHECK_MEMBERS([struct stat.st_atim])
28 AC_CHECK_MEMBERS([struct stat.st_atimespec])
30 diff --git a/util/ulockmgr_server.c b/util/ulockmgr_server.c
31 index 273c7d923..a04dac5c6 100644
32 --- a/util/ulockmgr_server.c
33 +++ b/util/ulockmgr_server.c
34 @@ -22,6 +22,10 @@
35 #include <sys/socket.h>
36 #include <sys/wait.h>
38 +#ifdef HAVE_CONFIG_H
39 + #include "config.h"
40 +#endif
41 +
42 struct message {
43 unsigned intr : 1;
44 unsigned nofd : 1;
45 @@ -124,6 +128,7 @@ static int receive_message(int sock, void *buf, size_t buflen, int *fdp,
46 return res;
47 }
49 +#if !defined(HAVE_CLOSEFROM)
50 static int closefrom(int minfd)
51 {
52 DIR *dir = opendir("/proc/self/fd");
53 @@ -141,6 +146,7 @@ static int closefrom(int minfd)
54 }
55 return 0;
56 }
57 +#endif
59 static void send_reply(int cfd, struct message *msg)
60 {