summaryrefslogtreecommitdiff
path: root/source/a/sysvinit/sysvinit-2.86-timeval.patch
blob: acb0d5b68dfcad81ccd54e8b8e1d1f5691677baf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- sysvinit-2.86/src/utmp.c.timeval	1999-06-09 07:11:33.000000000 -0400
+++ sysvinit-2.86/src/utmp.c	2006-08-09 19:46:26.000000000 -0400
@@ -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