autofs-5.2.0 - fix build with non-glibc C libraries in lib/misc.c
Subsystems (2)
PATCH 1/1 autofs-5.2.0 - fix build with non-glibc C libraries in lib/misc.c
The open/close on exec functions moved to lib/misc.c expect the GNU strerror_r() that returns a char pointer. Unlike the rest of autofs, misc.c does not include automount.h, which maps strerror_r() to autofs_strerror_r() when not building with glibc, so the build fails with musl:
misc.c:96:8: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
Do the same mapping in misc.c.
Signed-off-by Khem Raj <[email protected]>
--- lib/misc.c | 5 +++++ 1 file changed, 5 insertions(+)
lib/misc.c +5 -0
@@ -30,6 +30,11 @@#include "log.h" #include "misc.h" +#ifndef __GLIBC__ +# define strerror_r (N ,B ,S ) autofs_strerror_r(N,B,S) +char *autofs_strerror_r (int errnum,char *buf,size_t buflen);/* GNU */ +#endif +#define MAX_ERR_BUF 128static pthread_mutex_t open_mutex =PTHREAD_MUTEX_INITIALIZER ;