summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-01-31 23:48:28 +0000
committerThomas Bushnell <thomas@gnu.org>1999-01-31 23:48:28 +0000
commit74e57f6fef0a62090390c1bcb3a2cbd944398cfa (patch)
treea1a6ce5c5b5d04336ab326f13994eb1876c500c6
parent229a2b3040a479ccc6052fe6d6c464fe301151c9 (diff)
Sun Jan 31 18:33:55 1999 Thomas Bushnell, BSG <tb@mit.edu>
* netfs.c (netfs_attempt_utimes): Implement new possibility that ATIME or MTIME might be null.
-rw-r--r--ftpfs/ChangeLog5
-rw-r--r--ftpfs/netfs.c25
2 files changed, 24 insertions, 6 deletions
diff --git a/ftpfs/ChangeLog b/ftpfs/ChangeLog
index 17e39728..22eb11ce 100644
--- a/ftpfs/ChangeLog
+++ b/ftpfs/ChangeLog
@@ -1,3 +1,8 @@
+Sun Jan 31 18:33:55 1999 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * netfs.c (netfs_attempt_utimes): Implement new possibility that
+ ATIME or MTIME might be null.
+
1998-10-20 Roland McGrath <roland@baalperazim.frob.com>
* ftpfs.c (netfs_append_args): Add braces to silence gcc warning.
diff --git a/ftpfs/netfs.c b/ftpfs/netfs.c
index 02cea700..fb9a2ef6 100644
--- a/ftpfs/netfs.c
+++ b/ftpfs/netfs.c
@@ -1,6 +1,6 @@
/* ftpfs interface to libnetfs
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
This file is part of the GNU Hurd.
@@ -65,17 +65,30 @@ netfs_attempt_utimes (struct iouser *cred, struct node *node,
struct timespec *atime, struct timespec *mtime)
{
error_t err = ftpfs_refresh_node (node);
+ int flags = TOUCH_CTIME;
if (! err)
err = fshelp_isowner (&node->nn_stat, cred);
if (! err)
{
- node->nn_stat.st_mtime = mtime->tv_sec;
- node->nn_stat.st_mtime_usec = mtime->tv_nsec / 1000;
- node->nn_stat.st_atime = atime->tv_sec;
- node->nn_stat.st_atime_usec = atime->tv_nsec / 1000;
- fshelp_touch (&node->nn_stat, TOUCH_CTIME, ftpfs_maptime);
+ if (atime)
+ {
+ node->nn_stat.st_atime = atime->tv_sec;
+ node->nn_stat.st_atime_usec = atime->tv_nsec / 1000;
+ }
+ else
+ flags |= TOUCH_ATIME;
+
+ if (mtime)
+ {
+ node->nn_stat.st_mtime = mtime->tv_sec;
+ node->nn_stat.st_mtime_usec = mtime->tv_nsec / 1000;
+ }
+ else
+ flags |= TOUCH_MTIME;
+
+ fshelp_touch (&node->nn_stat, flags, ftpfs_maptime);
}
return err;