mirror of
https://github.com/skeeto/endlessh.git
synced 2025-02-20 13:20:47 +01:00
Always set standard output to line-buffered
When logging was enabled via the config file, standard output was left fully buffered. Logs should never be fully buffered. Thanks to Chang-Li for pointing this out.
This commit is contained in:
parent
6f621b90b1
commit
24bc7639d1
@ -624,8 +624,7 @@ main(int argc, char **argv)
|
||||
config_set_port(&config, optarg, 1);
|
||||
break;
|
||||
case 'v':
|
||||
if (!loglevel++)
|
||||
setvbuf(stdout, 0, _IOLBF, 0);
|
||||
loglevel++;
|
||||
break;
|
||||
case 'V':
|
||||
print_version();
|
||||
@ -642,6 +641,9 @@ main(int argc, char **argv)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Set output (log) to line buffered */
|
||||
setvbuf(stdout, 0, _IOLBF, 0);
|
||||
|
||||
/* Log configuration */
|
||||
config_log(&config);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user