summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCraig Small <csmall@dropbear.xyz>2023-05-07 11:10:17 +1000
committerCraig Small <csmall@dropbear.xyz>2023-05-07 20:27:50 +1000
commitc8afe6ff845e3bed9abf83fe818503278373b344 (patch)
treeb7154f395cbe3f3a36aaebcc781b3358a2600240 /src
parent786335b9673f9c3af0b3897799b30b205e99748a (diff)
downloadprocps-ng-c8afe6ff845e3bed9abf83fe818503278373b344.tar.gz
w: Fix musl UT_HOSTSIZE issue
While musl has utmpx.h, their header file does not define all the values, especially __UT_HOSTSIZE and friends. Instead it just hard codes the sizes :/ This change will look for that definition specifically and if not found will include utmp.h too. Checked on Alpine 3.17 musl just makes these a stub so w doesn't work anyway. Signed-off-by: Craig Small <csmall@dropbear.xyz>
Diffstat (limited to 'src')
-rw-r--r--src/w.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/w.c b/src/w.c
index 80a867b..093cfbc 100644
--- a/src/w.c
+++ b/src/w.c
@@ -45,7 +45,10 @@
#include <time.h>
#include <unistd.h>
#ifdef HAVE_UTMPX_H
-# include <utmpx.h>
+#include <utmpx.h>
+#ifndef HAVE_UT_HOSTSIZE_IN_UTMPX
+#include <utmp.h>
+#endif
#else
# include <utmp.h>
#endif