diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-10-21 20:13:18 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-10-21 20:13:18 +0200 |
commit | 875550b9733eb35b25de3b70569bcc7233ae52cb (patch) | |
tree | 718c3cad493aad9c9acc4645b29a460331150704 | |
parent | 2d75a3d71ce3237a24aad748e8e1db05dcc44866 (diff) | |
download | passt-875550b9733eb35b25de3b70569bcc7233ae52cb.tar passt-875550b9733eb35b25de3b70569bcc7233ae52cb.tar.gz passt-875550b9733eb35b25de3b70569bcc7233ae52cb.tar.bz2 passt-875550b9733eb35b25de3b70569bcc7233ae52cb.tar.lz passt-875550b9733eb35b25de3b70569bcc7233ae52cb.tar.xz passt-875550b9733eb35b25de3b70569bcc7233ae52cb.tar.zst passt-875550b9733eb35b25de3b70569bcc7233ae52cb.zip |
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>
-rw-r--r-- | passt.1 | 2 | ||||
-rw-r--r-- | passt.c | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -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 @@ -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); } |