zed: remove unused zed_file_close_on_exec()

The FIXME comment was there since the initial implementation in 2014,
there are no users

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11807
This commit is contained in:
наб 2021-03-27 14:18:27 +01:00 committed by Brian Behlendorf
parent 9160c441a4
commit dbf8baf8dd
2 changed files with 0 additions and 30 deletions

View File

@ -187,31 +187,3 @@ zed_file_close_from(int lowfd)
errno = errno_bak; errno = errno_bak;
} }
/*
* Set the CLOEXEC flag on file descriptor [fd] so it will be automatically
* closed upon successful execution of one of the exec functions.
* Return 0 on success, or -1 on error.
*
* FIXME: No longer needed?
*/
int
zed_file_close_on_exec(int fd)
{
int flags;
if (fd < 0) {
errno = EBADF;
return (-1);
}
flags = fcntl(fd, F_GETFD);
if (flags == -1)
return (-1);
flags |= FD_CLOEXEC;
if (fcntl(fd, F_SETFD, flags) == -1)
return (-1);
return (0);
}

View File

@ -30,6 +30,4 @@ pid_t zed_file_is_locked(int fd);
void zed_file_close_from(int fd); void zed_file_close_from(int fd);
int zed_file_close_on_exec(int fd);
#endif /* !ZED_FILE_H */ #endif /* !ZED_FILE_H */