aboutsummaryrefslogtreecommitdiff
path: root/src/fd_util.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-10 16:53:24 +0100
committerMax Kellermann <max@duempel.org>2009-11-10 16:53:24 +0100
commite0e6813a1da123d5b0cc920c5e0f20b0028c830b (patch)
treec6c70cbf701472a2f27d6e5d5274f569721d1028 /src/fd_util.c
parent3d2a9d35450876fe28708340e2b4ed3831d9d9af (diff)
fd_util: removed creat_cloexec()
Add a "mode" argument to open_cloexec() instead.
Diffstat (limited to 'src/fd_util.c')
-rw-r--r--src/fd_util.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/fd_util.c b/src/fd_util.c
index f296aab9..f78b8ed8 100644
--- a/src/fd_util.c
+++ b/src/fd_util.c
@@ -101,7 +101,7 @@ fd_set_nonblock(int fd)
}
int
-open_cloexec(const char *path_fs, int flags)
+open_cloexec(const char *path_fs, int flags, int mode)
{
int fd;
@@ -113,26 +113,6 @@ open_cloexec(const char *path_fs, int flags)
flags |= O_NOCTTY;
#endif
- fd = open(path_fs, flags, 0666);
- fd_set_cloexec(fd, true);
-
- return fd;
-}
-
-int
-creat_cloexec(const char *path_fs, int mode)
-{
- int flags = O_CREAT|O_WRONLY|O_TRUNC;
- int fd;
-
-#ifdef O_CLOEXEC
- flags |= O_CLOEXEC;
-#endif
-
-#ifdef O_NOCTTY
- flags |= O_NOCTTY;
-#endif
-
fd = open(path_fs, flags, mode);
fd_set_cloexec(fd, true);