Commit 086eb79f authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Make previous patch build on linux.

2007-10-18  William Jon McCann  <mccann@jhu.edu>

	* configure.ac:
	* daemon/gdm-session.c: (gdm_session_write_record):
	Make previous patch build on linux.


svn path=/trunk/; revision=5378
parent dfb8ae48
2007-10-18 William Jon McCann <mccann@jhu.edu>
* configure.ac:
* daemon/gdm-session.c: (gdm_session_write_record):
Make previous patch build on linux.
2007-10-18 William Jon McCann <mccann@jhu.edu>
* configure.ac:
......
......@@ -11,6 +11,9 @@ AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
# for utmpx stuff
AC_GNU_SOURCE
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
......@@ -475,9 +478,9 @@ dnl ---------------------------------------------------------------------------
AC_CHECK_HEADERS(utmp.h utmpx.h libutil.h sys/param.h)
AC_CHECK_FUNCS([getutxent updwtmpx updwtmp])
AC_CHECK_LIB(util,login)
AC_CHECK_LIB(util,logout)
AC_CHECK_LIB(util,logwtmp)
AC_CHECK_LIB(util, login)
AC_CHECK_LIB(util, logout)
AC_CHECK_LIB(util, logwtmp)
GDM_CHECK_UTMP
AC_MSG_CHECKING(if utmpx structure has ut_syslen field)
......
......@@ -43,7 +43,9 @@
#if defined(HAVE_UTMPX_H)
#include <utmpx.h>
#elif defined(HAVE_UTMP_H)
#endif
#if defined(HAVE_UTMP_H)
#include <utmp.h>
#endif
......@@ -184,14 +186,13 @@ static void
gdm_session_write_record (GdmSession *session,
GdmSessionRecordType record_type)
{
#if defined(HAVE_UTMPX_H)
struct utmpx session_record = { 0 };
struct utmpx *u = NULL;
#elif defined(HAVE_UTMP_H)
struct utmp session_record = { 0 };
#endif
UTMP session_record = { 0 };
UTMP *u;
GTimeVal now = { 0 };
char *hostname, *username;
char *hostname;
char *username;
u = NULL;
g_debug ("Writing %s utmp/wtmp record",
record_type == GDM_SESSION_RECORD_TYPE_LOGIN ? "session" :
......@@ -355,7 +356,7 @@ gdm_session_write_record (GdmSession *session,
endutxent ();
/* Add new entry if update did not work */
if (u == (struct utmpx *)NULL) {
if (u == NULL) {
g_debug ("Adding new utmp record");
pututxline (&session_record);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment