Skip to content

Commit

Permalink
zed: remove unused zed_file_close_on_exec()
Browse files Browse the repository at this point in the history
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 openzfs#11807
  • Loading branch information
nabijaczleweli authored and adamdmoss committed Apr 10, 2021
1 parent 1079b32 commit 7f311cb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
28 changes: 0 additions & 28 deletions cmd/zed/zed_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 0 additions & 2 deletions cmd/zed/zed_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 7f311cb

Please sign in to comment.