summaryrefslogtreecommitdiff
path: root/sessreg.h
diff options
context:
space:
mode:
authorEd Schouten <ed@80386.nl>2011-06-26 14:04:20 +0200
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-06-26 09:30:31 -0700
commit18d68ce74bd810bc09f99a476798b8e4a66ec494 (patch)
treec6defc3bc8077905ada0a235df8fc41ae9f92672 /sessreg.h
parent9e93c5f65a22824f6b4af7ee68944f2226f7efa7 (diff)
Make lastlog work on BSD systems without <lastlog.h>.
FreeBSD 8.x and lower have struct lastlog in <utmp.h>. Add a specific Autoconf check for struct lastlog, where we include both <utmp.h> and <lastlog.h>. Also, change NO_LASTLOG to a definition for the opposite; USE_LASTLOG. This is more consistent with USE_UTMP and USE_UTMPX. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'sessreg.h')
-rw-r--r--sessreg.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/sessreg.h b/sessreg.h
index 0b93dc7..a5e7f83 100644
--- a/sessreg.h
+++ b/sessreg.h
@@ -67,19 +67,12 @@
# include <sys/param.h>
#endif
-#ifndef HAVE_LASTLOG_H
-# define NO_LASTLOG
-#endif
-
-#ifndef NO_LASTLOG
-# ifdef CSRG_BASED
-# if (BSD < 199103)
-# include <lastlog.h>
-# endif
-# else
-# include <lastlog.h>
+#if defined(HAVE_STRUCT_LASTLOG) && defined(HAVE_PWD_H)
+# ifdef HAVE_LASTLOG_H
+# include <lastlog.h>
# endif
-# include <pwd.h>
+# include <pwd.h>
+# define USE_LASTLOG
#endif
#ifdef CSRG_BASED