diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2015-12-31 20:01:24 -0500 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2015-12-31 20:01:24 -0500 |
commit | ffa927fa361c366d8d1d2fefdeb58d0977ab91ae (patch) | |
tree | 99cc94fa94a648ab86139c18133cf410fb6298ca /other/bootstrap_daemon/src/tox-bootstrapd.c | |
parent | a40fd1bb6c4769683c11b3e308279c17a0acbc5a (diff) |
Rename LOGGER_BACKEND to LOG_BACKEND
Diffstat (limited to 'other/bootstrap_daemon/src/tox-bootstrapd.c')
-rw-r--r-- | other/bootstrap_daemon/src/tox-bootstrapd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/other/bootstrap_daemon/src/tox-bootstrapd.c b/other/bootstrap_daemon/src/tox-bootstrapd.c index e2bf7ade..3bbddf98 100644 --- a/other/bootstrap_daemon/src/tox-bootstrapd.c +++ b/other/bootstrap_daemon/src/tox-bootstrapd.c | |||
@@ -544,7 +544,7 @@ bool print_help() | |||
544 | // Handels command line arguments, setting cfg_file_path and log_backend. | 544 | // Handels command line arguments, setting cfg_file_path and log_backend. |
545 | // Terminates the application if incorrect arguments are specified. | 545 | // Terminates the application if incorrect arguments are specified. |
546 | 546 | ||
547 | void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, LOGGER_BACKEND *log_backend) | 547 | void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, LOG_BACKEND *log_backend) |
548 | { | 548 | { |
549 | if (argc < 2) { | 549 | if (argc < 2) { |
550 | write_log(LOG_LEVEL_ERROR, "Error: No arguments provided.\n\n"); | 550 | write_log(LOG_LEVEL_ERROR, "Error: No arguments provided.\n\n"); |
@@ -581,10 +581,10 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, | |||
581 | 581 | ||
582 | case 'l': | 582 | case 'l': |
583 | if (strcmp(optarg, "syslog") == 0) { | 583 | if (strcmp(optarg, "syslog") == 0) { |
584 | *log_backend = LOGGER_BACKEND_SYSLOG; | 584 | *log_backend = LOG_BACKEND_SYSLOG; |
585 | log_backend_set = true; | 585 | log_backend_set = true; |
586 | } else if (strcmp(optarg, "stdout") == 0) { | 586 | } else if (strcmp(optarg, "stdout") == 0) { |
587 | *log_backend = LOGGER_BACKEND_STDOUT; | 587 | *log_backend = LOG_BACKEND_STDOUT; |
588 | log_backend_set = true; | 588 | log_backend_set = true; |
589 | } else { | 589 | } else { |
590 | write_log(LOG_LEVEL_ERROR, "Error: Invalid BACKEND value for --log-backend option passed: %s\n\n", optarg); | 590 | write_log(LOG_LEVEL_ERROR, "Error: Invalid BACKEND value for --log-backend option passed: %s\n\n", optarg); |
@@ -610,7 +610,7 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, | |||
610 | } | 610 | } |
611 | 611 | ||
612 | if (!log_backend_set) { | 612 | if (!log_backend_set) { |
613 | *log_backend = LOGGER_BACKEND_SYSLOG; | 613 | *log_backend = LOG_BACKEND_SYSLOG; |
614 | } | 614 | } |
615 | 615 | ||
616 | if (!cfg_file_path_set) { | 616 | if (!cfg_file_path_set) { |
@@ -623,10 +623,10 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, | |||
623 | int main(int argc, char *argv[]) | 623 | int main(int argc, char *argv[]) |
624 | { | 624 | { |
625 | char *cfg_file_path; | 625 | char *cfg_file_path; |
626 | LOGGER_BACKEND log_backend; | 626 | LOG_BACKEND log_backend; |
627 | 627 | ||
628 | // choose backend for printing command line argument parsing output based on whether the daemon is being run from a terminal | 628 | // choose backend for printing command line argument parsing output based on whether the daemon is being run from a terminal |
629 | log_backend = isatty(STDOUT_FILENO) ? LOGGER_BACKEND_STDOUT : LOGGER_BACKEND_SYSLOG; | 629 | log_backend = isatty(STDOUT_FILENO) ? LOG_BACKEND_STDOUT : LOG_BACKEND_SYSLOG; |
630 | 630 | ||
631 | open_log(log_backend); | 631 | open_log(log_backend); |
632 | handle_command_line_arguments(argc, argv, &cfg_file_path, &log_backend); | 632 | handle_command_line_arguments(argc, argv, &cfg_file_path, &log_backend); |
@@ -798,7 +798,7 @@ int main(int argc, char *argv[]) | |||
798 | } | 798 | } |
799 | 799 | ||
800 | // Go quiet | 800 | // Go quiet |
801 | if (log_backend != LOGGER_BACKEND_STDOUT) { | 801 | if (log_backend != LOG_BACKEND_STDOUT) { |
802 | close(STDOUT_FILENO); | 802 | close(STDOUT_FILENO); |
803 | close(STDIN_FILENO); | 803 | close(STDIN_FILENO); |
804 | close(STDERR_FILENO); | 804 | close(STDERR_FILENO); |