[Pkg-shadow-commits] r2817 - in upstream/trunk: . libmisc
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Mon Apr 27 20:06:26 UTC 2009
Author: nekral-guest
Date: 2009-04-27 20:06:25 +0000 (Mon, 27 Apr 2009)
New Revision: 2817
Modified:
upstream/trunk/ChangeLog
upstream/trunk/libmisc/utmp.c
Log:
* libmisc/utmp.c: Replace HAVE_UTMPX_H by USE_UTMPX.
* libmisc/utmp.c: Removed old comment on HAVE_STRUCT_UTMP_UT_ID
and UTMPX support.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2009-04-27 20:03:48 UTC (rev 2816)
+++ upstream/trunk/ChangeLog 2009-04-27 20:06:25 UTC (rev 2817)
@@ -3,6 +3,9 @@
* NEWS, configure.in: Added configure option --enable-utmpx,
disabled by default. This defines USE_UTMPX, which should be used
instead of HAVE_UTMPX_H.
+ * libmisc/utmp.c: Replace HAVE_UTMPX_H by USE_UTMPX.
+ * libmisc/utmp.c: Removed old comment on HAVE_STRUCT_UTMP_UT_ID
+ and UTMPX support.
2009-04-27 Nicolas François <nicolas.francois at centraliens.net>
Modified: upstream/trunk/libmisc/utmp.c
===================================================================
--- upstream/trunk/libmisc/utmp.c 2009-04-27 20:03:48 UTC (rev 2816)
+++ upstream/trunk/libmisc/utmp.c 2009-04-27 20:06:25 UTC (rev 2817)
@@ -37,10 +37,7 @@
#include <utmp.h>
-// FIXME: disable UTMPX on Linux in configure.in
-// Maybe define an intermediate USE_UTMPX to replace HAVE_UTMPX_H,
-// which would be defined if HAVE_UTMPX_H is defined on non-Linux.
-#if HAVE_UTMPX_H
+#if USE_UTMPX
#include <utmpx.h>
#endif
@@ -149,7 +146,7 @@
}
#endif /* ! HAVE_UPDWTMP */
-#ifdef HAVE_UTMPX_H
+#ifdef USE_UTMPX
#ifndef HAVE_UPDWTMPX
static void updwtmpx (const char *filename, const struct utmpx *utx)
{
@@ -162,7 +159,7 @@
}
}
#endif /* ! HAVE_UPDWTMPX */
-#endif /* ! HAVE_UTMPX_H */
+#endif /* ! USE_UTMPX */
/*
@@ -184,9 +181,9 @@
* The returned structure shall be freed by the caller.
*/
/*@only@*/struct utmp *prepare_utmp (const char *name,
- const char *line,
- const char *host,
- /*@null@*/const struct utmp *ut)
+ const char *line,
+ const char *host,
+ /*@null@*/const struct utmp *ut)
{
struct timeval tv;
char *hostname = NULL;
@@ -322,14 +319,14 @@
return err;
}
-#ifdef HAVE_UTMPX_H
+#ifdef USE_UTMPX
/*
* prepare_utmpx - the UTMPX version for prepare_utmp
*/
/*@only@*/struct utmpx *prepare_utmpx (const char *name,
- const char *line,
- const char *host,
- /*@null@*/const struct utmp *ut)
+ const char *line,
+ const char *host,
+ /*@null@*/const struct utmp *ut)
{
struct timeval tv;
char *hostname = NULL;
@@ -366,10 +363,7 @@
utxent->ut_type = USER_PROCESS;
utxent->ut_pid = getpid ();
strncpy (utxent->ut_line, line, sizeof (utxent->ut_line));
-#ifndef HAVE_STRUCT_UTMP_UT_ID
-// FIXME: move to configure.in
-# error "No support for systems with utmpx and no ut_id field in utmp"
-#endif /* !HAVE_STRUCT_UTMP_UT_ID */
+ /* existence of ut->ut_id is enforced by configure */
if (NULL != ut) {
strncpy (utxent->ut_id, ut->ut_id, sizeof (utxent->ut_id));
} else {
@@ -457,5 +451,5 @@
return err;
}
-#endif /* HAVE_UTMPX_H */
+#endif /* USE_UTMPX */
More information about the Pkg-shadow-commits
mailing list