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 */