summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-01-31 23:49:27 +0000
committerThomas Bushnell <thomas@gnu.org>1999-01-31 23:49:27 +0000
commite5b20b2e303e29c99192846d550df4532410688e (patch)
treeb33147d1ec78b4853dc8fab77750749f69fd1ba7 /libdiskfs
parent8723e50bdd67bbc25157fc64a3d336c0f9c38fc1 (diff)
Sun Jan 31 18:24:33 1999 Thomas Bushnell, BSG <tb@mit.edu>
* file-utimes.c (diskfs_S_file_utimes): Implement new semantics for setting to exactly present time.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/ChangeLog5
-rw-r--r--libdiskfs/file-utimes.c22
2 files changed, 23 insertions, 4 deletions
diff --git a/libdiskfs/ChangeLog b/libdiskfs/ChangeLog
index 06d3fd5c..3fd85ff9 100644
--- a/libdiskfs/ChangeLog
+++ b/libdiskfs/ChangeLog
@@ -1,3 +1,8 @@
+Sun Jan 31 18:24:33 1999 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * file-utimes.c (diskfs_S_file_utimes): Implement new semantics
+ for setting to exactly present time.
+
1999-01-27 Roland McGrath <roland@baalperazim.frob.com>
* Makefile (OTHERSRCS): Add init-main.c.
diff --git a/libdiskfs/file-utimes.c b/libdiskfs/file-utimes.c
index 98db0738..b87aa18e 100644
--- a/libdiskfs/file-utimes.c
+++ b/libdiskfs/file-utimes.c
@@ -1,5 +1,5 @@
/* libdiskfs implementation of fs.defs: file_utimes
- Copyright (C) 1992, 1993, 1994, 1998 Free Software Foundation
+ Copyright (C) 1992, 1993, 1994, 1998, 1999 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -28,10 +28,24 @@ diskfs_S_file_utimes (struct protid *cred,
({
if (!(err = fshelp_isowner (&np->dn_stat, cred->user)))
{
- np->dn_stat.st_atime = atime.seconds;
- np->dn_stat.st_mtime = mtime.seconds;
- np->dn_set_atime = np->dn_set_mtime = 0;
+ if (atime.microseconds == -1)
+ np->dn_set_atime = 1;
+ else
+ {
+ np->dn_stat.st_atime = atime.seconds;
+ np->dn_set_atime = 0;
+ }
+
+ if (mtime.microseconds == -1)
+ np->dn_set_mtime = 1;
+ else
+ {
+ np->dn_stat.st_mtime = mtime.seconds;
+ np->dn_set_mtime = 0;
+ }
+
np->dn_set_ctime = 1;
+
if (np->filemod_reqs)
diskfs_notice_filechange (np,
FILE_CHANGED_META,