ffserver: check chdir() return
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 7 Jan 2012 22:05:20 +0000 (23:05 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 7 Jan 2012 23:18:36 +0000 (00:18 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffserver.c

index 5ee5c32..80a36c7 100644 (file)
@@ -499,7 +499,10 @@ static void start_children(FFStream *feed)
                 }
 
                 /* This is needed to make relative pathnames work */
-                chdir(my_program_dir);
+                if (chdir(my_program_dir) < 0) {
+                    http_log("chdir failed\n");
+                    exit(1);
+                }
 
                 signal(SIGPIPE, SIG_DFL);