]>
Commit | Line | Data |
---|---|---|
8c09d4df AM |
1 | --- sysvinit-2.86/src/utmp.c.timeval 1999-06-09 07:11:33.000000000 -0400 |
2 | +++ sysvinit-2.86/src/utmp.c 2006-08-09 19:46:26.000000000 -0400 | |
3 | @@ -47,7 +47,8 @@ | |
4 | int fd; | |
5 | struct utmp utmp; | |
6 | struct utsname uname_buf; | |
7 | - | |
8 | + struct timeval tv; | |
9 | + | |
10 | /* | |
11 | * Try to open the wtmp file. Note that we even try | |
12 | * this if we have updwtmp() so we can see if the | |
13 | @@ -76,7 +77,9 @@ | |
14 | */ | |
15 | memset(&utmp, 0, sizeof(utmp)); | |
16 | #if defined(__GLIBC__) | |
17 | - gettimeofday(&utmp.ut_tv, NULL); | |
18 | + gettimeofday(&tv, NULL); | |
19 | + utmp.ut_tv.tv_sec = tv.tv_sec; | |
20 | + utmp.ut_tv.tv_usec = tv.tv_usec; | |
21 | #else | |
22 | time(&utmp.ut_time); | |
23 | #endif | |
24 | @@ -113,6 +116,7 @@ | |
25 | struct utmp utmp; | |
26 | struct utmp tmp; | |
27 | struct utmp *utmptr; | |
28 | + struct timeval tv; | |
29 | ||
30 | /* | |
31 | * Can't do much if UTMP_FILE is not present. | |
32 | @@ -144,7 +148,9 @@ | |
33 | utmp.ut_pid = pid; | |
34 | strncpy(utmp.ut_id, id, sizeof(utmp.ut_id)); | |
35 | #if defined(__GLIBC__) | |
36 | - gettimeofday(&utmp.ut_tv, NULL); | |
37 | + gettimeofday(&tv, NULL); | |
38 | + utmp.ut_tv.tv_sec = tv.tv_sec; | |
39 | + utmp.ut_tv.tv_usec = tv.tv_usec; | |
40 | #else | |
41 | time(&utmp.ut_time); | |
42 | #endif |