[PATCH] Fix for the FEATURE_UTMP on the FreeBSD

Alex Samorukov samm at os2.kiev.ua
Mon Jan 4 18:35:09 UTC 2021


FreeBSD is not using <utmp.h> and does not define _PATH_UTMPX.
Tested with busybox applets depending on FEATURE_UTMP (e.g. who, users, etc)

Signed-off-by: Alex Samorukov <samm at os2.kiev.ua>
---
 include/libbb.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/libbb.h b/include/libbb.h
index dad6fc687..664bf0410 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -106,7 +106,11 @@
 #  define updwtmpx updwtmp
 #  define _PATH_UTMPX _PATH_UTMP
 # else
+#ifndef __FreeBSD__
 #  include <utmp.h>
+#else
+#define  _PATH_UTMPX "/var/run/utx.active"
+#endif
 #  include <utmpx.h>
 #  if defined _PATH_UTMP && !defined _PATH_UTMPX
 #   define _PATH_UTMPX _PATH_UTMP
-- 
2.29.1



More information about the busybox mailing list