diff options
Diffstat (limited to 'login')
-rw-r--r-- | login/ChangeLog | 5 | ||||
-rw-r--r-- | login/utmp.c | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/login/ChangeLog b/login/ChangeLog index 80477012..be61d98e 100644 --- a/login/ChangeLog +++ b/login/ChangeLog @@ -1,3 +1,8 @@ +2009-02-02 Samuel Thibault <samuel.thibault@ens-lyon.org> + + * utmp.c (S_login_get_idle_time): Use st_atim.tv_sec and + st_atim.tv_nsec members instead of st_atime and st_atime_usec. + 1999-07-09 Thomas Bushnell, BSG <tb@mit.edu> * utmp.c (return_data): Use mmap instead of vm_allocate. diff --git a/login/utmp.c b/login/utmp.c index 37d17421..a872d371 100644 --- a/login/utmp.c +++ b/login/utmp.c @@ -326,12 +326,12 @@ S_login_get_idle_time(file_t utmp, time_value_t *tv) { struct stat stat; if (stat(dev, &state) == 0 - && (stat.st_atime < tv->seconds - || (stat.st_atime == tv->seconds - && stat.st_atime_usec < tv->microseconds))) + && (stat.st_atim.tv_sec < tv->seconds + || (stat.st_atim.tv_sec == tv->seconds + && stat.st_atim.tv_nsec / 1000 < tv->microseconds))) { - tv->seconds = stat.st_atime; - tv->microseconds = stat.st_atime_usec; + tv->seconds = stat.st_atim.tv_sc; + tv->microseconds = stat.st_atim.tv_nsec / 1000; } } } |