mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 16:58:35 +00:00
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: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
parent
06b81a2862
commit
a573be11a1
@ -154,11 +154,18 @@ int main(int argc, char *argv[])
|
|||||||
return -1;
|
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) {
|
if (thread) {
|
||||||
printf("Starting threaded listener.\n");
|
printf("Starting threaded listener.\n");
|
||||||
|
fflush(stdout);
|
||||||
esl_listen_threaded(ip, port, mycallback, 100000);
|
esl_listen_threaded(ip, port, mycallback, 100000);
|
||||||
} else {
|
} else {
|
||||||
printf("Starting forking listener.\n");
|
printf("Starting forking listener.\n");
|
||||||
|
fflush(stdout);
|
||||||
esl_listen(ip, port, my_forking_callback);
|
esl_listen(ip, port, my_forking_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user