summary refs log tree commit diff
path: root/Src/watch.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/watch.c')
-rw-r--r--Src/watch.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Src/watch.c b/Src/watch.c
index c12625c85..402b160fe 100644
--- a/Src/watch.c
+++ b/Src/watch.c
@@ -87,6 +87,14 @@
 
 #if !defined(WATCH_STRUCT_UTMP) && defined(HAVE_STRUCT_UTMPX) && defined(REAL_UTMPX_FILE)
 # define WATCH_STRUCT_UTMP struct utmpx
+/*
+ * In utmpx, the ut_name field is replaced by ut_user.
+ * Howver, on some systems ut_name may already be defined this
+ * way for the purposes of utmp.
+ */
+# ifndef ut_name
+#  define ut_name ut_user
+# endif
 # ifdef HAVE_STRUCT_UTMPX_UT_XTIME
 #  undef ut_time
 #  define ut_time ut_xtime