diff options
author | наб <[email protected]> | 2021-03-27 14:18:27 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-04-14 13:19:49 -0700 |
commit | dbf8baf8dd6f767777c9a3219ae9c4dd601f90a4 (patch) | |
tree | 9b970531dfaf53ac306966f7e5bd5aa181ca5709 | |
parent | 9160c441a442fd57ab3fe9ce9de0a06156f6ef20 (diff) |
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 <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #11807
-rw-r--r-- | cmd/zed/zed_file.c | 28 | ||||
-rw-r--r-- | cmd/zed/zed_file.h | 2 |
2 files changed, 0 insertions, 30 deletions
diff --git a/cmd/zed/zed_file.c b/cmd/zed/zed_file.c index b51b1ca9d..4437892e9 100644 --- a/cmd/zed/zed_file.c +++ b/cmd/zed/zed_file.c @@ -187,31 +187,3 @@ zed_file_close_from(int lowfd) 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); -} diff --git a/cmd/zed/zed_file.h b/cmd/zed/zed_file.h index 7dcae8381..28a5dd0cc 100644 --- a/cmd/zed/zed_file.h +++ b/cmd/zed/zed_file.h @@ -30,6 +30,4 @@ pid_t zed_file_is_locked(int fd); void zed_file_close_from(int fd); -int zed_file_close_on_exec(int fd); - #endif /* !ZED_FILE_H */ |