[FFmpeg-cvslog] r13911 - trunk/ffserver.c

stefano subversion
Mon Jun 23 21:43:39 CEST 2008


Author: stefano
Date: Mon Jun 23 21:43:38 2008
New Revision: 13911

Log:
 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.


Modified:
   trunk/ffserver.c

Modified: trunk/ffserver.c
==============================================================================
--- trunk/ffserver.c	(original)
+++ trunk/ffserver.c	Mon Jun 23 21:43:38 2008
@@ -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);




More information about the ffmpeg-cvslog mailing list