From 0c1740982d4d1e2a7d945f0d59d0b207eda55485 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 10 Aug 2017 19:46:23 +0200 Subject: [PATCH] system/fd_util: remove unused function open_cloexec() --- src/system/fd_util.c | 20 -------------------- src/system/fd_util.h | 7 ------- 2 files changed, 27 deletions(-) diff --git a/src/system/fd_util.c b/src/system/fd_util.c index d554ad796..72c1e830c 100644 --- a/src/system/fd_util.c +++ b/src/system/fd_util.c @@ -101,26 +101,6 @@ fd_set_nonblock(int fd) #endif } -int -open_cloexec(const char *path_fs, int flags, int mode) -{ - int fd; - -#ifdef O_CLOEXEC - flags |= O_CLOEXEC; -#endif - -#ifdef O_NOCTTY - flags |= O_NOCTTY; -#endif - - fd = open(path_fs, flags, mode); - if (fd >= 0) - fd_set_cloexec(fd, true); - - return fd; -} - int pipe_cloexec_nonblock(int fd[2]) { diff --git a/src/system/fd_util.h b/src/system/fd_util.h index 1b0126f85..4442f32b4 100644 --- a/src/system/fd_util.h +++ b/src/system/fd_util.h @@ -54,13 +54,6 @@ extern "C" { int fd_set_cloexec(int fd, bool enable); -/** - * Wrapper for open(), which sets the CLOEXEC flag (atomically if - * supported by the OS). - */ -int -open_cloexec(const char *path_fs, int flags, int mode); - /** * Wrapper for pipe(), which sets the CLOEXEC flag (atomically if * supported by the OS).