@cryptotaxi247 / netdata-1 / commits / 2bf8aef34

more musl compatibility fixes

Costa Tsaousis (ktsaou) committed Sep 27, 2016 at 01:14 UTC 2bf8aef34a73eb6c90e8564b6d910c74e6700e9a
1 file changed +6 -1
src/log.c
+6 -1
@@ -101,7 +101,7 @@ void reopen_all_log_files() {
101
102 void open_all_log_files() {
103 // disable stdin
104 - open_log_file(STDIN_FILENO, &stdin, "/dev/null", NULL);
104 + open_log_file(STDIN_FILENO, (FILE **)&stdin, "/dev/null", NULL);
105
106 open_log_file(STDOUT_FILENO, (FILE **)&stdout, stdout_filename, &output_log_syslog);
107 open_log_file(STDERR_FILENO, (FILE **)&stderr, stderr_filename, &error_log_syslog);
@@ -283,7 +283,12 @@ void error_int( const char *prefix, const char *file, const char *function, cons
283
284 if(errno) {
285 char buf[1024];
286 +#if ((_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE)
287 + strerror_r(errno, buf, 1023);
288 + fprintf(stderr, " (errno %d, %s)\n", errno, buf);
289 +#else
290 fprintf(stderr, " (errno %d, %s)\n", errno, strerror_r(errno, buf, 1023));
291 +#endif
292 errno = 0;
293 }
294 else