core: Support closefrom also for glibc.

* src/posix-io.c (_gpgme_io_spawn): Use glibc's closefrom.
--

Since 2.34, glibc introduces closefrom (the implementation
follows *BSD standard).

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Jiri Kucera 2021-07-25 11:35:54 +02:00 committed by Werner Koch
parent a5662a801f
commit 4b64774b6d
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -570,7 +570,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
if (fd_list[i].fd > fd) if (fd_list[i].fd > fd)
fd = fd_list[i].fd; fd = fd_list[i].fd;
fd++; fd++;
#if defined(__sun) || defined(__FreeBSD__) #if defined(__sun) || defined(__FreeBSD__) || defined(__GLIBC__)
closefrom (fd); closefrom (fd);
max_fds = fd; max_fds = fd;
#else /*!__sun */ #else /*!__sun */