summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schouten <ed@80386.nl>2011-06-26 09:43:37 +0200
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-06-26 09:30:31 -0700
commit6b9a2f7bfa823a3dc0befd039ee08ec1596a3c64 (patch)
tree3a2c7516a8db5dda676c3cb46749f034ca01dfdb
parent578b76086edb834aa447ce9aed60c585e44e6cc1 (diff)
Get rid of SYSV definition. Just check for pututline().
If the system provides pututline(), we just want to use that, instead of specifically checking for certain operating systems. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--configure.ac2
-rw-r--r--sessreg.c20
2 files changed, 9 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index 6d616ae..739abfa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,7 +55,7 @@ AC_CHECK_MEMBERS([
AC_CHECK_MEMBERS([struct utmpx.ut_syslen], [], [], [#include <utmpx.h>])
# Checks for library functions.
-AC_CHECK_FUNCS([updwtmpx utmpxname])
+AC_CHECK_FUNCS([pututline updwtmpx utmpxname])
# Obtain compiler/linker options for depedencies
PKG_CHECK_MODULES(SESSREG, xproto)
diff --git a/sessreg.c b/sessreg.c
index 7bce6ef..899b070 100644
--- a/sessreg.c
+++ b/sessreg.c
@@ -77,10 +77,6 @@
# include <stdio.h>
# include <stdlib.h>
-#if defined(__SVR4) || defined(SVR4) || defined(linux) || defined(__GLIBC__)
-# define SYSV
-#endif
-
#include <time.h>
#define Time_t time_t
@@ -111,7 +107,7 @@ static int utmp_none, wtmp_none;
*/
static int hflag, sflag, xflag, tflag;
static char *host_name = NULL;
-#ifdef USE_UTMP
+#if defined(USE_UTMP) && !defined(HAVE_PUTUTLINE)
static int slot_number;
#endif
static char *xservers_file, *ttys_file;
@@ -124,7 +120,7 @@ static int llog_none, Lflag;
static char *program_name;
-#ifndef SYSV
+#if defined(USE_UTMP) && !defined(HAVE_PUTUTLINE)
static int findslot (char *line_name, char *host_name, int addp, int slot);
static int Xslot (char *ttys_file, char *servers_file, char *tty_line,
char *host_name, int addp);
@@ -160,7 +156,7 @@ getstring (char ***avp, int *flagp)
return *a;
}
-#ifndef SYSV
+#if defined(USE_UTMP) && !defined(HAVE_PUTUTLINE)
static int
syserr (int x, const char *s)
{
@@ -185,7 +181,7 @@ sysnerr (int x, const char *s)
int
main (int argc, char **argv)
{
-#if defined(USE_UTMP) && !defined(SYSV)
+#if defined(USE_UTMP) && !defined(HAVE_PUTUTLINE)
int utmp;
#endif
#ifndef USE_UTMPX
@@ -229,7 +225,7 @@ main (int argc, char **argv)
host_name = getstring (&argv, &hflag);
break;
case 's':
-#ifdef USE_UTMP
+#if defined(USE_UTMP) && !defined(HAVE_PUTUTLINE)
slot_number = atoi (getstring (&argv, &sflag));
#endif
break;
@@ -275,7 +271,7 @@ main (int argc, char **argv)
if (!Lflag)
llog_file = LLOG_FILE;
#endif
-#if defined(USE_UTMP) && !defined(SYSV) && !defined(linux) && !defined(__QNX__)
+#if defined(USE_UTMP) && !defined(HAVE_PUTUTLINE)
if (!tflag)
ttys_file = TTYS_FILE;
if (!sflag && !utmp_none) {
@@ -320,7 +316,7 @@ main (int argc, char **argv)
}
#endif
#ifdef USE_UTMP
-# ifdef SYSV
+# ifdef HAVE_PUTUTLINE
utmpname (utmp_file);
setutent ();
(void) getutid (&utmp_entry);
@@ -546,7 +542,7 @@ set_utmpx (struct utmpx *u, const char *line, const char *user,
}
#endif /* USE_UTMPX */
-#if defined(USE_UTMP) && !defined(SYSV)
+#if defined(USE_UTMP) && !defined(HAVE_PUTUTLINE)
/*
* compute the slot-number for an X display. This is computed
* by counting the lines in /etc/ttys and adding the line-number