Commit bcae3c9d authored by stefano's avatar stefano

Make ffserver daemon chdir()s just after log init. This way a

relative path for the logfile is resolved according to the directory
where ffserver has been launched, as the user expects.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13911 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0358223b
...@@ -4496,7 +4496,6 @@ int main(int argc, char **argv) ...@@ -4496,7 +4496,6 @@ int main(int argc, char **argv)
} else { } else {
/* child */ /* child */
setsid(); setsid();
chdir("/");
close(0); close(0);
open("/dev/null", O_RDWR); open("/dev/null", O_RDWR);
if (strcmp(logfilename, "-") != 0) { if (strcmp(logfilename, "-") != 0) {
...@@ -4520,6 +4519,9 @@ int main(int argc, char **argv) ...@@ -4520,6 +4519,9 @@ int main(int argc, char **argv)
av_log_set_callback(http_av_log); av_log_set_callback(http_av_log);
} }
if (ffserver_daemon)
chdir("/");
if (http_server() < 0) { if (http_server() < 0) {
http_log("Could not start server\n"); http_log("Could not start server\n");
exit(1); exit(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment