diff options
-rwxr-xr-x | doc/demo.sh | 2 | ||||
-rw-r--r-- | passt.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/doc/demo.sh b/doc/demo.sh index c7d2eac..83f9e78 100755 --- a/doc/demo.sh +++ b/doc/demo.sh @@ -115,4 +115,4 @@ echo echo "Starting passt..." echo -ip netns exec "${ns}" ./passt +ip netns exec "${ns}" ./passt | cat @@ -797,7 +797,7 @@ int main(int argc, char **argv) #if DEBUG openlog("passt", LOG_PERROR, LOG_DAEMON); #else - openlog("passt", 0, LOG_DAEMON); + openlog("passt", isatty(fileno(stdout)) ? 0 : LOG_PERROR, LOG_DAEMON); #endif get_routes(&c); @@ -870,7 +870,7 @@ listen: " -net nic,model=virtio", sock_index); #ifndef DEBUG - if (daemon(0, 0)) { + if (isatty(fileno(stdout)) && daemon(0, 0)) { fprintf(stderr, "Failed to fork into background\n"); exit(EXIT_FAILURE); } |