aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/mount.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index b3e8c478c..77382ff51 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -737,7 +737,7 @@ static int daemonize(void)
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
- if (fd > 2) close(fd);
+ while (fd > 2) close(fd--);
setsid();
openlog(applet_name, LOG_PID, LOG_DAEMON);
logmode = LOGMODE_SYSLOG;