diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2023-07-06 18:25:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-06 18:25:17 +0300 |
commit | 3cc220ff5e38ef5cd96a64596c7e0c370d0fa074 (patch) | |
tree | 0d68db69102899db5add949f90b2b17ad7dc66e9 /libnetdata | |
parent | 3f787778390f11a9f6fb3ae9e7e2aeb36b1b7e53 (diff) |
local-listeners: use host prefix in read_cmdline (#15320)
* local-listeners: use host prefix in read_cmdline
* automatically use stderr instead of stderror
---------
Co-authored-by: Costa Tsaousis <costa@netdata.cloud>
Diffstat (limited to 'libnetdata')
-rw-r--r-- | libnetdata/log/log.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libnetdata/log/log.c b/libnetdata/log/log.c index 0ce989457b..02b9edc8f5 100644 --- a/libnetdata/log/log.c +++ b/libnetdata/log/log.c @@ -634,7 +634,7 @@ int error_log_limit(int reset) { static time_t start = 0; static unsigned long counter = 0, prevented = 0; - FILE *fp = stderror; + FILE *fp = stderror ? stderror : stderr; // fprintf(fp, "FLOOD: counter=%lu, allowed=%lu, backup=%lu, period=%llu\n", counter, error_log_errors_per_period, error_log_errors_per_period_backup, (unsigned long long)error_log_throttle_period); @@ -841,7 +841,7 @@ static const char *strerror_result_string(const char *a, const char *b) { (void) #endif void error_limit_int(ERROR_LIMIT *erl, const char *prefix, const char *file __maybe_unused, const char *function __maybe_unused, const unsigned long line __maybe_unused, const char *fmt, ... ) { - FILE *fp = stderror; + FILE *fp = stderror ? stderror : stderr; if(erl->sleep_ut) sleep_usec(erl->sleep_ut); @@ -975,7 +975,7 @@ static void print_call_stack(void) { #endif void fatal_int( const char *file, const char *function, const unsigned long line, const char *fmt, ... ) { - FILE *fp = stderror; + FILE *fp = stderror ? stderror : stderr; // save a copy of errno - just in case this function generates a new error int __errno = errno; |