summaryrefslogtreecommitdiff
path: root/src/libstddjb
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-01-02 01:52:51 +0000
committerLaurent Bercot <ska@appnovation.com>2024-01-02 01:52:51 +0000
commit86e231a8dfcd1e032bda5f927214bf385222ff02 (patch)
treee7e666d6f75319e3439503612ad49ed105f1a72e /src/libstddjb
parent1f4796c190f54afb12b959bcd3f8c097d8e115ba (diff)
downloadskalibs-86e231a8dfcd1e032bda5f927214bf385222ff02.tar.xz
cspawn can use open3() over open() for consistency
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libstddjb')
-rw-r--r--src/libstddjb/cspawn.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libstddjb/cspawn.c b/src/libstddjb/cspawn.c
index e0c4bcd..683a0a3 100644
--- a/src/libstddjb/cspawn.c
+++ b/src/libstddjb/cspawn.c
@@ -7,7 +7,6 @@
#endif
#include <errno.h>
-#include <fcntl.h>
#include <unistd.h>
#include <skalibs/allreadwrite.h>
@@ -15,7 +14,6 @@
#include <skalibs/djbunix.h>
#include <skalibs/selfpipe.h>
#include <skalibs/exec.h>
-
#include <skalibs/cspawn.h>
static inline void cspawn_child_exec (char const *prog, char const *const *argv, char const *const *envp, uint16_t flags, cspawn_fileaction const *fa, size_t n)
@@ -34,7 +32,7 @@ static inline void cspawn_child_exec (char const *prog, char const *const *argv,
break ;
case CSPAWN_FA_OPEN :
{
- int fd = open(fa[i].x.openinfo.file, fa[i].x.openinfo.oflag, fa[i].x.openinfo.mode) ;
+ int fd = open3(fa[i].x.openinfo.file, fa[i].x.openinfo.oflag, fa[i].x.openinfo.mode) ;
if (fd == -1) return ;
if (fd_move(fa[i].x.openinfo.fd, fd) == -1) return ;
break ;