FreeBSD's closefrom(2) does not return errors

This commit is contained in:
Pietro Cerutti 2017-04-03 08:31:40 +00:00 committed by Werner Koch
parent 5d4f977dac
commit 50565982cd
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -473,7 +473,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
* have closefrom(2) we first figure out the highest fd we
* do not want to close, then call closefrom, and on success
* use the regular code to close all fds up to the start
* point of closefrom. Note that Solaris' closefrom does
* point of closefrom. Note that Solaris' and FreeBSD's closefrom do
* not return errors. */
#ifdef HAVE_CLOSEFROM
{
@ -482,7 +482,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
if (fd_list[i].fd > fd)
fd = fd_list[i].fd;
fd++;
#ifdef __sun
#if defined(__sun) || defined(__FreeBSD__)
closefrom (fd);
max_fds = fd;
#else /*!__sun */