aboutsummaryrefslogtreecommitdiff
path: root/src/rc/start-stop-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/start-stop-daemon.c')
-rw-r--r--src/rc/start-stop-daemon.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index eb7490be..53de7bd2 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -653,8 +653,7 @@ int start_stop_daemon(int argc, char **argv)
char line[130];
FILE *fp;
size_t len;
- bool setumask = false;
- mode_t numask;
+ mode_t numask = 022;
char **margv;
unsigned int start_wait = 0;
@@ -775,7 +774,6 @@ int start_stop_daemon(int argc, char **argv)
if (parse_mode(&numask, optarg))
eerrorx("%s: invalid mode `%s'",
applet, optarg);
- setumask = true;
break;
case 'm': /* --make-pidfile */
@@ -1041,8 +1039,7 @@ int start_stop_daemon(int argc, char **argv)
/* Child process - lets go! */
if (pid == 0) {
pid_t mypid = getpid();
- if (setumask)
- umask(numask);
+ umask(numask);
#ifdef TIOCNOTTY
tty_fd = open("/dev/tty", O_RDWR);
@@ -1161,8 +1158,6 @@ int start_stop_daemon(int argc, char **argv)
setenv("PATH", newpath, 1);
}
- umask(022);
-
stdout_fd = devnull_fd;
stderr_fd = devnull_fd;
if (redirect_stdout) {