ffserver: make statement block unconditional by exiting early

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
pull/138/head
Reynaldo H. Verdejo Pinochet 10 years ago
parent 36a617c162
commit 08724da976
  1. 8
      ffserver.c

@ -3771,15 +3771,16 @@ static void compute_bandwidth(void)
static void handle_child_exit(int sig)
{
pid_t pid;
int status;
int status, uptime;
while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
FFServerStream *feed;
for (feed = config.first_feed; feed; feed = feed->next) {
if (feed->pid == pid) {
int uptime = time(0) - feed->pid_start;
if (feed->pid != pid)
continue;
uptime = time(0) - feed->pid_start;
feed->pid = 0;
fprintf(stderr,
"%s: Pid %d exited with status %d after %d seconds\n",
@ -3790,7 +3791,6 @@ static void handle_child_exit(int sig)
ffserver_free_child_args(&feed->child_argv);
}
}
}
need_to_start_children = 1;
}

Loading…
Cancel
Save