summaryrefslogtreecommitdiff
path: root/login/utmp.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-02-02 03:04:47 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2009-02-02 03:04:47 +0000
commit53c84862ce0de17f6d63d26cfa20008c57dc7074 (patch)
tree8172c29f4836491a1cf0b213e9f38f5478f7594c /login/utmp.c
parent85e3a07564fa347c8b801d35b6b7d6c1a917b775 (diff)
[ftpfs]
2009-02-02 Samuel Thibault <samuel.thibault@ens-lyon.org> * dir.c (ftpfs_refresh_node): Use st_mtim.tv_sec members instead of st_mtime. Also compare st_mtim.tv_nsec members. [libdiskfs] 2009-02-02 Samuel Thibault <samuel.thibault@ens-lyon.org> * file-utimes.c (diskfs_S_file_utimes): Use st_atim.tv_sec/ st_mtim.tv_sec members instead of st_atime/st_mtime. Also set st_atim.tv_nsec/st_mtim.tv_nsec members. [libftpconn] 2009-02-02 Samuel Thibault <samuel.thibault@ens-lyon.org> * unix.c (parse_dir_entry): Use st_mtim.tv_sec instead of st_mtime. Set st_atim.tv_nsec, st_ctim.tv_nsec and st_mtim.tv_nsec to 0. [login] 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. [tmpfs] 2009-02-02 Samuel Thibault <samuel.thibault@ens-lyon.org> * tmpfs.h (struct disknode): Make atime, mtime and ctime members struct timespec instead of time_t. * tmpfs.c (main): Copy st_atim/st_mtim/st_ctim members from st to diskfs_root_node->dn_stat instead of st_atime/st_mtime/st_ctime. * node.c (diskfs_node_norefs): Copy st_atime/st_mtime/st_ctime members from np->dn_stat to atime/mtime/ctime members of np->dn (diskfs_cached_lookup): Conversely.
Diffstat (limited to 'login/utmp.c')
-rw-r--r--login/utmp.c10
1 files changed, 5 insertions, 5 deletions
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;
}
}
}