From 830900ff6acaed219002c037b023b1883be1374b Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Thu, 30 Dec 2021 15:29:30 -0800 Subject: [PATCH] libredirect: fix musl build --- pkgs/build-support/libredirect/libredirect.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/libredirect/libredirect.c b/pkgs/build-support/libredirect/libredirect.c index 7dac4684722f..9dde78c74922 100644 --- a/pkgs/build-support/libredirect/libredirect.c +++ b/pkgs/build-support/libredirect/libredirect.c @@ -112,7 +112,8 @@ WRAPPER(int, open)(const char * path, int flags, ...) } WRAPPER_DEF(open) -#ifndef __APPLE__ +// In musl libc, open64 is simply a macro for open +#if !defined(__APPLE__) && !defined(open64) WRAPPER(int, open64)(const char * path, int flags, ...) { int (*open64_real) (const char *, int, mode_t) = LOOKUP_REAL(open64); @@ -162,7 +163,8 @@ WRAPPER(FILE *, __nss_files_fopen)(const char * path) WRAPPER_DEF(__nss_files_fopen) #endif -#ifndef __APPLE__ +// In musl libc, fopen64 is simply a macro for fopen +#if !defined(__APPLE__) && !defined(fopen64) WRAPPER(FILE *, fopen64)(const char * path, const char * mode) { FILE * (*fopen64_real) (const char *, const char *) = LOOKUP_REAL(fopen64);