1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

Bug fix #263: Always redirect std{out,err} if --logpath is specified

Always redirect std{out,err} if --logpath is specified, instead of only
redirect after fork, to correct the inconsistent behavior of --logpath
when getppid() returns 1. (#263)
This commit is contained in:
Richard Grenville 2015-01-26 21:28:48 +08:00
parent 64b4fe2c72
commit 3b17fe15f0

View file

@ -4965,7 +4965,6 @@ fork_after(session_t *ps) {
printf_errf("(): freopen() failed.");
return false;
}
success = ostream_reopen(ps, NULL);
return success;
}
@ -7444,6 +7443,10 @@ session_init(session_t *ps_old, int argc, char **argv) {
}
}
// Redirect output stream
if (ps->o.fork_after_register || ps->o.logpath)
ostream_reopen(ps, NULL);
write_pid(ps);
// Free the old session