aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fuse_loop_mt.c
diff options
context:
space:
mode:
authorlegezywzh <94814730+legezywzh@users.noreply.github.com>2023-10-25 19:19:39 +0800
committerGitHub <noreply@github.com>2023-10-25 12:19:39 +0100
commitc814e3fac0d0f9a9060b9c02f8396ee7bdad2d70 (patch)
tree931866fc7e49989a1f33da2de18765bd38702e57 /lib/fuse_loop_mt.c
parent463871a535799d3a3b01562b928f89040cfa11cd (diff)
downloadlibfuse-c814e3fac0d0f9a9060b9c02f8396ee7bdad2d70.tar.gz
fuse_clone_chan: avoid additional FD_CLOEXEC setting if O_CLOEXEC defined (#852)
Since open(2) has been called with O_CLOEXEC flag if defined. Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com> Co-authored-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
Diffstat (limited to 'lib/fuse_loop_mt.c')
-rw-r--r--lib/fuse_loop_mt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/fuse_loop_mt.c b/lib/fuse_loop_mt.c
index 0200d73..1d8b7b3 100644
--- a/lib/fuse_loop_mt.c
+++ b/lib/fuse_loop_mt.c
@@ -259,7 +259,9 @@ static struct fuse_chan *fuse_clone_chan(struct fuse_mt *mt)
strerror(errno));
return NULL;
}
+#ifndef O_CLOEXEC
fcntl(clonefd, F_SETFD, FD_CLOEXEC);
+#endif
masterfd = mt->se->fd;
res = ioctl(clonefd, FUSE_DEV_IOC_CLONE, &masterfd);