aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-02-25 10:51:05 +0000
committerRoy Marples <roy@marples.name>2008-02-25 10:51:05 +0000
commitbf2cebf2d8ab82789e5e087871a6e0dbca6289b9 (patch)
treeb4beb34a124a258d1a5de5ba1e18bfe08a8f2259
parentd1f7f0a3044b87f9693d43ece70b88a7d2f0dffa (diff)
With --quiet, we should quiet the daemon we're starting too.
-rw-r--r--src/rc/start-stop-daemon.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index 29525c96..d0e168af 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -1025,12 +1025,11 @@ int start_stop_daemon (int argc, char **argv)
applet, redirect_stderr, strerror (errno));
}
- if (background) {
- /* Hmmm, some daemons may need stdin? */
- dup2 (devnull_fd, STDIN_FILENO);
+ /* We don't redirect stdin as some daemons may need it */
+ if (background || quiet || redirect_stdout)
dup2 (stdout_fd, STDOUT_FILENO);
+ if (background || quiet || redirect_stderr)
dup2 (stderr_fd, STDERR_FILENO);
- }
for (i = getdtablesize () - 1; i >= 3; --i)
close(i);