blob: f3de55f7b33bd7120f94642c27113a2a80598785 [file] [log] [blame]
Andrew Geissler5f350902021-07-23 13:09:54 -04001From adb1d4e5498a19e9d591ac8f42f9ddfdb23a1354 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 15 Jul 2021 12:33:13 -0700
4Subject: [PATCH] use closefrom() on linux and glibc 2.34+
5
6Upstream-Status: Pending
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00008
9Rebase to 1.17.0
10Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Andrew Geissler5f350902021-07-23 13:09:54 -040011---
12 src/posix-io.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/src/posix-io.c b/src/posix-io.c
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000016index 5c6cf1d..52e513a 100644
Andrew Geissler5f350902021-07-23 13:09:54 -040017--- a/src/posix-io.c
18+++ b/src/posix-io.c
19@@ -570,7 +570,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
20 if (fd_list[i].fd > fd)
21 fd = fd_list[i].fd;
22 fd++;
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000023-#if defined(__sun) || defined(__FreeBSD__) || defined(__GLIBC__)
Andrew Geissler5f350902021-07-23 13:09:54 -040024+#if defined(__sun) || defined(__FreeBSD__) || (defined(__GLIBC__) && __GNUC_PREREQ(2, 34))
25 closefrom (fd);
26 max_fds = fd;
27 #else /*!__sun */
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000028--
292.25.1
30