mirror of
https://github.com/anope/anope.git
synced 2026-07-01 09:16:37 +02:00
Fixed ./services --version etc not getting printed when stdout is a file/pipe/not a tty
This commit is contained in:
+3
-6
@@ -252,12 +252,9 @@ void Fork()
|
||||
#ifndef _WIN32
|
||||
kill(getppid(), SIGUSR2);
|
||||
|
||||
if (isatty(fileno(stdout)))
|
||||
fclose(stdout);
|
||||
if (isatty(fileno(stdin)))
|
||||
fclose(stdin);
|
||||
if (isatty(fileno(stderr)))
|
||||
fclose(stderr);
|
||||
freopen("/dev/null", "r", stdin);
|
||||
freopen("/dev/null", "w", stdout);
|
||||
freopen("/dev/null", "w", stderr);
|
||||
|
||||
setpgid(0, 0);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user