Browse Source

* daemon.c : fix reopen usage (thx Denis Denisov)

master
Alex 'AdUser' Z 9 years ago
parent
commit
fc9bd994f7
  1. 6
      src/daemon.c

6
src/daemon.c

@ -292,9 +292,9 @@ int main(int argc, char *argv[]) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (chdir("/") != 0 || if (chdir("/") != 0 ||
freopen("/dev/null", "r", stdin) == NULL || (stdin = freopen("/dev/null", "r", stdin)) == NULL ||
freopen("/dev/null", "w", stdout) == NULL || (stdout = freopen("/dev/null", "w", stdout)) == NULL ||
freopen("/dev/null", "w", stderr) == NULL) { (stderr = freopen("/dev/null", "w", stderr)) == NULL) {
perror("child: freopen() failed"); perror("child: freopen() failed");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

Loading…
Cancel
Save