diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-01-31 23:50:52 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-01-31 23:50:52 +0000 |
commit | 0458f1b8f5348c55785434a5ea2f8f8c1217e7db (patch) | |
tree | b0624f6525eb2133f93f0bc64993d7490982ffba /usermux | |
parent | 991964495b65f3f6d3a043d8fc5b7fe8c20728d3 (diff) |
Sun Jan 31 18:41:17 1999 Thomas Bushnell, BSG <tb@mit.edu>
* node.c (netfs_attempt_utimes): Handle new possibility that ATIME
or MTIME might be null.
Diffstat (limited to 'usermux')
-rw-r--r-- | usermux/ChangeLog | 5 | ||||
-rw-r--r-- | usermux/node.c | 24 |
2 files changed, 24 insertions, 5 deletions
diff --git a/usermux/ChangeLog b/usermux/ChangeLog index f4602d55..0b34da7c 100644 --- a/usermux/ChangeLog +++ b/usermux/ChangeLog @@ -1,3 +1,8 @@ +Sun Jan 31 18:41:17 1999 Thomas Bushnell, BSG <tb@mit.edu> + + * node.c (netfs_attempt_utimes): Handle new possibility that ATIME + or MTIME might be null. + 1998-10-20 Roland McGrath <roland@baalperazim.frob.com> * mux.c (get_dirents): Add braces to silence gcc warning. diff --git a/usermux/node.c b/usermux/node.c index fa8bfdd7..e4a161d8 100644 --- a/usermux/node.c +++ b/usermux/node.c @@ -1,6 +1,6 @@ /* General fs node functions - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.ai.mit.edu> This file is part of the GNU Hurd. @@ -74,12 +74,26 @@ netfs_attempt_utimes (struct iouser *cred, struct node *node, struct timespec *atime, struct timespec *mtime) { error_t err = fshelp_isowner (&node->nn_stat, cred); + int flags = TOUCH_CTIME; + 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; + if (mtime) + { + node->nn_stat.st_mtime = mtime->tv_sec; + node->nn_stat.st_mtime_usec = mtime->tv_nsec / 1000; + } + else + flags |= TOUCH_MTIME; + + if (atime) + { + node->nn_stat.st_atime = atime->tv_sec; + node->nn_stat.st_atime_usec = atime->tv_nsec / 1000; + } + else + flags != TOUCH_ATIME; + fshelp_touch (&node->nn_stat, TOUCH_CTIME, usermux_maptime); } return err; |