From 929b2f60c36b80b7a8e6237d5e8ccc981a3a1e0d Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 4 Nov 2014 16:27:57 -0800 Subject: If both utmp & utmpx interfaces are available, just use utmpx As we already do with wtmp & wtmpx, where only one of the interface sets is compiled in at a time, stop building & potentially calling both the utmp & utmpx interfaces, which could lead to confusion and corruption, especially when xdm passed -u /.../utmpx and sessreg wrote utmp format records to the file instead. Signed-off-by: Alan Coopersmith --- sessreg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sessreg.h b/sessreg.h index 71e93f1..947f49f 100644 --- a/sessreg.h +++ b/sessreg.h @@ -53,7 +53,8 @@ #include #include -#ifdef HAVE_UTMP_H +/* Prefer POSIX standard utmpx interfaces if present, otherwise use utmp */ +#if defined(HAVE_UTMP_H) && !defined(HAVE_UTMPX_H) # include # define USE_UTMP #endif -- cgit v1.2.3