1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-23 06:25:24 +00:00

Cleanup: make strcmp() more explicit in _start_logging()

This avoids if(strcmp()) constructs in favor of if(strcmp() == 0)
constructs. This is aligned with coding style and will improve
readability of the code.

Thanks to miksago. closes #2102
This commit is contained in:
Philipp Schafft 2014-12-14 08:19:58 +00:00
parent b498d4bd93
commit 8a4c529347

View File

@ -227,15 +227,15 @@ static int _start_logging(void)
ice_config_t *config = config_get_config_unlocked();
if(strcmp(config->error_log, "-")) {
if(strcmp(config->error_log, "-") == 0) {
/* this is already in place because of _start_logging_stdout() */
} else {
snprintf(fn_error, FILENAME_MAX, "%s%s%s", config->log_dir, PATH_SEPARATOR, config->error_log);
errorlog = log_open(fn_error);
log_to_stderr = 0;
if (config->logsize)
log_set_trigger (errorlog, config->logsize);
log_set_archive_timestamp(errorlog, config->logarchive);
} else {
/* this is already in place because of _start_logging_stdout() */
}
if (errorlog < 0) {
@ -248,16 +248,16 @@ static int _start_logging(void)
}
log_set_level(errorlog, config->loglevel);
if(strcmp(config->access_log, "-")) {
if(strcmp(config->access_log, "-") == 0) {
accesslog = log_open_file(stderr);
log_to_stderr = 1;
} else {
snprintf(fn_access, FILENAME_MAX, "%s%s%s", config->log_dir, PATH_SEPARATOR, config->access_log);
accesslog = log_open(fn_access);
log_to_stderr = 0;
if (config->logsize)
log_set_trigger (accesslog, config->logsize);
log_set_archive_timestamp(accesslog, config->logarchive);
} else {
accesslog = log_open_file(stderr);
log_to_stderr = 1;
}
if (accesslog < 0) {