1
0
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:
Adam
2012-04-22 02:57:17 -04:00
parent 7372b457cc
commit fc00406079
2 changed files with 4 additions and 10 deletions
+3 -6
View File
@@ -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