Skip to content

Commit

Permalink
Fix for compilation with Musl.
Browse files Browse the repository at this point in the history
Musl only has stub implementations of utmp* functions, and doesn't
define _PATH_UTMPX nor _PATH_WTMPX.
  • Loading branch information
davmac314 committed May 2, 2019
1 parent a829fc7 commit be8c80c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/includes/dinit-utmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,20 @@
#endif
#endif

#if USE_UTMPX
#include <utmpx.h>
// 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 <cstring>

#include <utmpx.h>
#include <sys/time.h>

// Set the time for a utmpx record to the current time.
Expand Down

0 comments on commit be8c80c

Please sign in to comment.