diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-11-04 16:27:57 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-11-04 16:31:14 -0800 |
commit | 929b2f60c36b80b7a8e6237d5e8ccc981a3a1e0d (patch) | |
tree | 4f1f90348409c147d0a98c0d40608c5c041e41f8 | |
parent | 0a234ecc502b3e08d8f81d51fb724d97e8045504 (diff) |
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 <alan.coopersmith@oracle.com>
-rw-r--r-- | sessreg.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -53,7 +53,8 @@ #include <sys/types.h> #include <time.h> -#ifdef HAVE_UTMP_H +/* Prefer POSIX standard utmpx interfaces if present, otherwise use utmp */ +#if defined(HAVE_UTMP_H) && !defined(HAVE_UTMPX_H) # include <utmp.h> # define USE_UTMP #endif |