mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
ffserver: reindent start_children()
Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
This commit is contained in:
parent
ec42251715
commit
18011888cc
56
ffserver.c
56
ffserver.c
@ -407,43 +407,41 @@ static void start_children(FFServerStream *feed)
|
|||||||
if (!feed->child_argv || feed->pid)
|
if (!feed->child_argv || feed->pid)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
feed->pid_start = time(0);
|
feed->pid_start = time(0);
|
||||||
|
|
||||||
feed->pid = fork();
|
feed->pid = fork();
|
||||||
|
if (feed->pid < 0) {
|
||||||
|
http_log("Unable to create children\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (feed->pid < 0) {
|
if (feed->pid)
|
||||||
http_log("Unable to create children\n");
|
continue;
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (feed->pid)
|
/* In child */
|
||||||
continue;
|
|
||||||
|
|
||||||
/* In child */
|
http_log("Launch command line: ");
|
||||||
|
http_log("%s ", pathname);
|
||||||
|
|
||||||
http_log("Launch command line: ");
|
for (i = 1; feed->child_argv[i] && feed->child_argv[i][0]; i++)
|
||||||
http_log("%s ", pathname);
|
http_log("%s ", feed->child_argv[i]);
|
||||||
for (i = 1; feed->child_argv[i] && feed->child_argv[i][0]; i++)
|
http_log("\n");
|
||||||
http_log("%s ", feed->child_argv[i]);
|
|
||||||
http_log("\n");
|
|
||||||
|
|
||||||
for (i = 3; i < 256; i++)
|
for (i = 3; i < 256; i++)
|
||||||
close(i);
|
close(i);
|
||||||
|
|
||||||
if (!config.debug) {
|
if (!config.debug) {
|
||||||
if (!freopen("/dev/null", "r", stdin))
|
if (!freopen("/dev/null", "r", stdin))
|
||||||
http_log("failed to redirect STDIN to /dev/null\n;");
|
http_log("failed to redirect STDIN to /dev/null\n;");
|
||||||
if (!freopen("/dev/null", "w", stdout))
|
if (!freopen("/dev/null", "w", stdout))
|
||||||
http_log("failed to redirect STDOUT to /dev/null\n;");
|
http_log("failed to redirect STDOUT to /dev/null\n;");
|
||||||
if (!freopen("/dev/null", "w", stderr))
|
if (!freopen("/dev/null", "w", stderr))
|
||||||
http_log("failed to redirect STDERR to /dev/null\n;");
|
http_log("failed to redirect STDERR to /dev/null\n;");
|
||||||
}
|
}
|
||||||
|
|
||||||
signal(SIGPIPE, SIG_DFL);
|
signal(SIGPIPE, SIG_DFL);
|
||||||
|
execvp(pathname, feed->child_argv);
|
||||||
execvp(pathname, feed->child_argv);
|
_exit(1);
|
||||||
|
|
||||||
_exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user