From be8c80c9dc25821a1da19c780bf9c48814dc5b64 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Thu, 2 May 2019 21:41:15 +1000 Subject: [PATCH] Fix for compilation with Musl. Musl only has stub implementations of utmp* functions, and doesn't define _PATH_UTMPX nor _PATH_WTMPX. --- src/includes/dinit-utmp.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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. -- 2.25.1