mirror of
https://github.com/skeeto/endlessh.git
synced 2025-12-08 14:13:23 +00: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:
@@ -624,8 +624,7 @@ main(int argc, char **argv)
|
|||||||
config_set_port(&config, optarg, 1);
|
config_set_port(&config, optarg, 1);
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
if (!loglevel++)
|
loglevel++;
|
||||||
setvbuf(stdout, 0, _IOLBF, 0);
|
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
print_version();
|
print_version();
|
||||||
@@ -642,6 +641,9 @@ main(int argc, char **argv)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set output (log) to line buffered */
|
||||||
|
setvbuf(stdout, 0, _IOLBF, 0);
|
||||||
|
|
||||||
/* Log configuration */
|
/* Log configuration */
|
||||||
config_log(&config);
|
config_log(&config);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user