[Pkg-sysvinit-commits] r1418 - in sysvinit-upstream/trunk: doc src
Petter Reinholdtsen
pere at alioth.debian.org
Fri Jul 10 21:16:49 UTC 2009
Author: pere
Date: 2009-07-10 21:16:48 +0000 (Fri, 10 Jul 2009)
New Revision: 1418
Modified:
sysvinit-upstream/trunk/doc/Changelog
sysvinit-upstream/trunk/src/utmp.c
Log:
Fix utmp/wtmp updating on 64-bit platforms. Patch by Bill
Nottingham and Fedora.
Modified: sysvinit-upstream/trunk/doc/Changelog
===================================================================
--- sysvinit-upstream/trunk/doc/Changelog 2009-07-10 19:43:00 UTC (rev 1417)
+++ sysvinit-upstream/trunk/doc/Changelog 2009-07-10 21:16:48 UTC (rev 1418)
@@ -19,6 +19,8 @@
* Adjust build rules to make sure the installed binaries
are stripped.
* Increase the compiler warning level when building.
+ * Fix utmp/wtmp updating on 64-bit platforms. Patch by Bill
+ Nottingham and Fedora.
-- Petter Reinholdtsen <pere at debian.org> Fri, 30 Jul 2004 14:14:58 +0200
Modified: sysvinit-upstream/trunk/src/utmp.c
===================================================================
--- sysvinit-upstream/trunk/src/utmp.c 2009-07-10 19:43:00 UTC (rev 1417)
+++ sysvinit-upstream/trunk/src/utmp.c 2009-07-10 21:16:48 UTC (rev 1418)
@@ -47,7 +47,8 @@
int fd;
struct utmp utmp;
struct utsname uname_buf;
-
+ struct timeval tv;
+
/*
* Try to open the wtmp file. Note that we even try
* this if we have updwtmp() so we can see if the
@@ -76,7 +77,9 @@
*/
memset(&utmp, 0, sizeof(utmp));
#if defined(__GLIBC__)
- gettimeofday(&utmp.ut_tv, NULL);
+ gettimeofday(&tv, NULL);
+ utmp.ut_tv.tv_sec = tv.tv_sec;
+ utmp.ut_tv.tv_usec = tv.tv_usec;
#else
time(&utmp.ut_time);
#endif
@@ -113,6 +116,7 @@
struct utmp utmp;
struct utmp tmp;
struct utmp *utmptr;
+ struct timeval tv;
/*
* Can't do much if UTMP_FILE is not present.
@@ -144,7 +148,9 @@
utmp.ut_pid = pid;
strncpy(utmp.ut_id, id, sizeof(utmp.ut_id));
#if defined(__GLIBC__)
- gettimeofday(&utmp.ut_tv, NULL);
+ gettimeofday(&tv, NULL);
+ utmp.ut_tv.tv_sec = tv.tv_sec;
+ utmp.ut_tv.tv_usec = tv.tv_usec;
#else
time(&utmp.ut_time);
#endif
More information about the Pkg-sysvinit-commits
mailing list