aboutsummaryrefslogtreecommitdiffstats
path: root/ffserver.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2008-06-23 19:43:38 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2008-06-23 19:43:38 +0000
commit496a61329326de667f6be3cb8c47bce9c91cd664 (patch)
tree667ddd867034625641d7fef98ce94ab82f741cde /ffserver.c
parentb06759549fc3230f64c7e9fce614bbaabf52e92a (diff)
downloadffmpeg-496a61329326de667f6be3cb8c47bce9c91cd664.tar.gz
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. Originally committed as revision 13911 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ffserver.c b/ffserver.c
index bf2bef6e8e..ad001402d3 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -4496,7 +4496,6 @@ int main(int argc, char **argv)
} else {
/* child */
setsid();
- chdir("/");
close(0);
open("/dev/null", O_RDWR);
if (strcmp(logfilename, "-") != 0) {
@@ -4520,6 +4519,9 @@ int main(int argc, char **argv)
av_log_set_callback(http_av_log);
}
+ if (ffserver_daemon)
+ chdir("/");
+
if (http_server() < 0) {
http_log("Could not start server\n");
exit(1);