summaryrefslogtreecommitdiff
path: root/ftpfs/netfs.c
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 /ftpfs/netfs.c
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.
Diffstat (limited to 'ftpfs/netfs.c')
-rw-r--r--ftpfs/netfs.c25
1 files changed, 19 insertions, 6 deletions
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;