From 2bf8aef34a73eb6c90e8564b6d910c74e6700e9a Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Tue, 27 Sep 2016 01:14:24 +0300 Subject: [PATCH] more musl compatibility fixes --- src/log.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/log.c b/src/log.c index 63948ba2..3d8ebc7b 100644 --- a/src/log.c +++ b/src/log.c @@ -101,7 +101,7 @@ void reopen_all_log_files() { void open_all_log_files() { // disable stdin - open_log_file(STDIN_FILENO, &stdin, "/dev/null", NULL); + open_log_file(STDIN_FILENO, (FILE **)&stdin, "/dev/null", NULL); open_log_file(STDOUT_FILENO, (FILE **)&stdout, stdout_filename, &output_log_syslog); 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 if(errno) { char buf[1024]; +#if ((_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE) + strerror_r(errno, buf, 1023); + fprintf(stderr, " (errno %d, %s)\n", errno, buf); +#else fprintf(stderr, " (errno %d, %s)\n", errno, strerror_r(errno, buf, 1023)); +#endif errno = 0; } else -- 2.39.2