summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ftpfs/ChangeLog5
-rw-r--r--ftpfs/dir.c4
-rw-r--r--libdiskfs/ChangeLog6
-rw-r--r--libdiskfs/file-utimes.c6
-rw-r--r--libftpconn/ChangeLog5
-rw-r--r--libftpconn/unix.c7
-rw-r--r--login/ChangeLog5
-rw-r--r--login/utmp.c10
-rw-r--r--tmpfs/ChangeLog10
-rw-r--r--tmpfs/node.c12
-rw-r--r--tmpfs/tmpfs.c6
-rw-r--r--tmpfs/tmpfs.h2
12 files changed, 57 insertions, 21 deletions
diff --git a/ftpfs/ChangeLog b/ftpfs/ChangeLog
index e6df33b0..0b130fd6 100644
--- a/ftpfs/ChangeLog
+++ b/ftpfs/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2007-11-13 Thomas Schwinge <tschwinge@gnu.org>
* netfs.c (netfs_attempt_utimes): Adapt to ``struct stat'' changes.
diff --git a/ftpfs/dir.c b/ftpfs/dir.c
index 8544a325..fb35a451 100644
--- a/ftpfs/dir.c
+++ b/ftpfs/dir.c
@@ -532,7 +532,9 @@ ftpfs_refresh_node (struct node *node)
}
}
- if ((entry->stat.st_mtime < node->nn_stat.st_mtime
+ if ((entry->stat.st_mtim.tv_sec < node->nn_stat.st_mtim.tv_sec
+ || (entry->stat.st_mtim.tv_sec == node->nn_stat.st_mtim.tv_sec
+ && entry->stat.st_mtim.tv_nsec < node->nn_stat.st_mtim.tv_nsec)
|| entry->stat.st_size != node->nn_stat.st_size)
&& nn && nn->contents)
/* The file has changed. */
diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog
index e28dd799..7c98c793 100644
--- a/libdiskfs/ChangeLog
+++ b/libdiskfs/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2008-08-21 Samuel Thibault <samuel.thibault@ens-lyon.org>
* dir-lookup.c (diskfs_S_dir_lookup): Initialize NEWPI and NEWPO to
diff --git a/libdiskfs/file-utimes.c b/libdiskfs/file-utimes.c
index b87aa18e..39fac504 100644
--- a/libdiskfs/file-utimes.c
+++ b/libdiskfs/file-utimes.c
@@ -32,7 +32,8 @@ diskfs_S_file_utimes (struct protid *cred,
np->dn_set_atime = 1;
else
{
- np->dn_stat.st_atime = atime.seconds;
+ np->dn_stat.st_atim.tv_sec = atime.seconds;
+ np->dn_stat.st_atim.tv_nsec = atime.microseconds * 1000;
np->dn_set_atime = 0;
}
@@ -40,7 +41,8 @@ diskfs_S_file_utimes (struct protid *cred,
np->dn_set_mtime = 1;
else
{
- np->dn_stat.st_mtime = mtime.seconds;
+ np->dn_stat.st_mtim.tv_sec = mtime.seconds;
+ np->dn_stat.st_mtim.tv_nsec = mtime.microseconds * 1000;
np->dn_set_mtime = 0;
}
diff --git a/libftpconn/ChangeLog b/libftpconn/ChangeLog
index 409e6b0a..9f69ea25 100644
--- a/libftpconn/ChangeLog
+++ b/libftpconn/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2002-10-19 Roland McGrath <roland@frob.com>
* unix.c (ftp_conn_unix_start_get_stats): Pass dirname a copy of NAME
diff --git a/libftpconn/unix.c b/libftpconn/unix.c
index e2a460c7..d279a7a6 100644
--- a/libftpconn/unix.c
+++ b/libftpconn/unix.c
@@ -510,12 +510,13 @@ drwxrwxrwt 7 34 archive 512 May 1 14:28 /tmp
else
tm.tm_year = PARSE_INT () - 1900;
- stat->st_mtime = mktime (&tm);
- if (stat->st_mtime == (time_t)-1)
+ stat->st_mtim.tv_sec = mktime (&tm);
+ if (stat->st_mtim.tv_sec == (time_t)-1)
return EGRATUITOUS;
/* atime and ctime are the same as mtime. */
- stat->st_atime = stat->st_ctime = stat->st_mtime;
+ stat->st_atim.tv_sec = stat->st_ctim.tv_sec = stat->st_mtim.tv_sec;
+ stat->st_atim.tv_nsec = stat->st_ctim.tv_nsec = stat->st_mtim.tv_nsec = 0;
/* Update *LINE to point to the filename. */
SKIP_WS ();
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;
}
}
}
diff --git a/tmpfs/ChangeLog b/tmpfs/ChangeLog
index a5cb2989..ca44e3d2 100644
--- a/tmpfs/ChangeLog
+++ b/tmpfs/ChangeLog
@@ -1,3 +1,13 @@
+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.
+
2005-03-20 Marcus Brinkmann <marcus@gnu.org>
* tmpfs.c (parse_opt): Use the right argument for parsing the
diff --git a/tmpfs/node.c b/tmpfs/node.c
index fd6bd722..55a45723 100644
--- a/tmpfs/node.c
+++ b/tmpfs/node.c
@@ -96,9 +96,9 @@ diskfs_node_norefs (struct node *np)
np->dn->uid = np->dn_stat.st_uid;
np->dn->author = np->dn_stat.st_author;
np->dn->gid = np->dn_stat.st_gid;
- np->dn->atime = np->dn_stat.st_atime;
- np->dn->mtime = np->dn_stat.st_mtime;
- np->dn->ctime = np->dn_stat.st_ctime;
+ np->dn->atime = np->dn_stat.st_atim;
+ np->dn->mtime = np->dn_stat.st_mtim;
+ np->dn->ctime = np->dn_stat.st_ctim;
np->dn->flags = np->dn_stat.st_flags;
switch (np->dn->type)
@@ -200,9 +200,9 @@ diskfs_cached_lookup (ino_t inum, struct node **npp)
st->st_uid = dn->uid;
st->st_author = dn->author;
st->st_gid = dn->gid;
- st->st_atime = dn->atime;
- st->st_mtime = dn->mtime;
- st->st_ctime = dn->ctime;
+ st->st_atim = dn->atime;
+ st->st_mtim = dn->mtime;
+ st->st_ctim = dn->ctime;
st->st_flags = dn->flags;
st->st_rdev = 0;
diff --git a/tmpfs/tmpfs.c b/tmpfs/tmpfs.c
index 1539054f..cd67dd74 100644
--- a/tmpfs/tmpfs.c
+++ b/tmpfs/tmpfs.c
@@ -355,9 +355,9 @@ main (int argc, char **argv)
diskfs_root_node->dn_stat.st_uid = st.st_uid;
diskfs_root_node->dn_stat.st_author = st.st_author;
diskfs_root_node->dn_stat.st_gid = st.st_gid;
- diskfs_root_node->dn_stat.st_atime = st.st_atime;
- diskfs_root_node->dn_stat.st_mtime = st.st_mtime;
- diskfs_root_node->dn_stat.st_ctime = st.st_ctime;
+ diskfs_root_node->dn_stat.st_atim = st.st_atim;
+ diskfs_root_node->dn_stat.st_mtim = st.st_mtim;
+ diskfs_root_node->dn_stat.st_ctim = st.st_ctim;
diskfs_root_node->dn_stat.st_flags = st.st_flags;
}
diskfs_root_node->dn_stat.st_mode &= ~S_ITRANS;
diff --git a/tmpfs/tmpfs.h b/tmpfs/tmpfs.h
index 4fb418a2..3032ce3c 100644
--- a/tmpfs/tmpfs.h
+++ b/tmpfs/tmpfs.h
@@ -35,7 +35,7 @@ struct disknode
nlink_t nlink;
uid_t uid, author;
gid_t gid;
- time_t atime, mtime, ctime;
+ struct timespec atime, mtime, ctime;
unsigned int flags;
char *trans;