passt: Fork into background also if not running from a terminal
This is actually annoying: there's no way to make it fork into background when running from a script. However, it's always possible to keep it in foreground with -f. Make it simpler, and always fork into background if -f is not given. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
2d75a3d71c
commit
875550b973
2 changed files with 2 additions and 2 deletions
2
passt.1
2
passt.1
|
@ -81,7 +81,7 @@ Don't print informational messages.
|
|||
.TP
|
||||
.BR \-f ", " \-\-foreground
|
||||
Don't run in background.
|
||||
Default is to fork into background, if started from an interactive terminal.
|
||||
Default is to fork into background.
|
||||
|
||||
.TP
|
||||
.BR \-e ", " \-\-stderr
|
||||
|
|
2
passt.c
2
passt.c
|
@ -365,7 +365,7 @@ int main(int argc, char **argv)
|
|||
else
|
||||
__setlogmask(LOG_UPTO(LOG_INFO));
|
||||
|
||||
if (isatty(fileno(stdout)) && !c.foreground && daemon(0, 0)) {
|
||||
if (!c.foreground && daemon(0, 0)) {
|
||||
perror("daemon");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue