提交 ca1d4079 authored 作者: Stefan Knoblich's avatar Stefan Knoblich

ivrd: fflush() stdout before entering esl_listen()

Fixes repeatedly printing the 'Starting forking listener' message,
if stdout has been redirected into a logfile (for example).
Signed-off-by: 's avatarStefan Knoblich <stkn@openisdn.net>
上级 35410600
......@@ -154,13 +154,20 @@ int main(int argc, char *argv[])
return -1;
}
/*
* NOTE: fflush() stdout before entering esl_listen().
* Not doing so causes the fork()ed child to repeat the message for every incoming
* connection, if stdout has been redirected (into a logfile, for example).
*/
if (thread) {
printf("Starting threaded listener.\n");
fflush(stdout);
esl_listen_threaded(ip, port, mycallback, 100000);
} else {
printf("Starting forking listener.\n");
fflush(stdout);
esl_listen(ip, port, my_forking_callback);
}
return 0;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论