From 02a0fa19995a865fe5194f1777e77dc8779d89b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sat, 27 Mar 2021 14:18:27 +0100 Subject: [PATCH] zed: remove unused zed_file_close_on_exec() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The FIXME comment was there since the initial implementation in 2014, there are no users Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #11807 --- cmd/zed/zed_file.c | 28 ---------------------------- cmd/zed/zed_file.h | 2 -- 2 files changed, 30 deletions(-) diff --git a/cmd/zed/zed_file.c b/cmd/zed/zed_file.c index b51b1ca9dc..4437892e90 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 7dcae83810..28a5dd0cca 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 */