From: Davin McCall Date: Thu, 2 May 2019 11:41:15 +0000 (+1000) Subject: Fix for compilation with Musl. X-Git-Tag: v0.5.0 X-Git-Url: https://git.librecmc.org/?p=oweals%2Fdinit.git;a=commitdiff_plain;h=be8c80c9dc25821a1da19c780bf9c48814dc5b64 Fix for compilation with Musl. Musl only has stub implementations of utmp* functions, and doesn't define _PATH_UTMPX nor _PATH_WTMPX. --- diff --git a/src/includes/dinit-utmp.h b/src/includes/dinit-utmp.h index 579b196..4499876 100644 --- a/src/includes/dinit-utmp.h +++ b/src/includes/dinit-utmp.h @@ -33,11 +33,20 @@ #endif #endif +#if USE_UTMPX +#include +// Musl has a utmpx.h header but only stub implementations of the functions, and does not define _PATH_UTMPX +// nor _PATH_WTMPX. +#if !defined(_PATH_UTMPX) || !defined(_PATH_WTMPX) +#undef USE_UTMPX +#define USE_UTMPX 0 +#endif +#endif + #if USE_UTMPX #include -#include #include // Set the time for a utmpx record to the current time.