diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-01-31 23:48:47 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-01-31 23:48:47 +0000 |
commit | b6c287ffd8279da8bc5ffceb3e75e9c3595b2a2a (patch) | |
tree | 4e3744b885e5fbddaa6610cb10a146349821f5e8 /hostmux | |
parent | 74e57f6fef0a62090390c1bcb3a2cbd944398cfa (diff) |
Sun Jan 31 18:34:59 1999 Thomas Bushnell, BSG <tb@mit.edu>
* node.c (netfs_attempt_utimes): Implement new possibility that
ATIME or MTIME might be null.
Diffstat (limited to 'hostmux')
-rw-r--r-- | hostmux/ChangeLog | 5 | ||||
-rw-r--r-- | hostmux/node.c | 26 |
2 files changed, 25 insertions, 6 deletions
diff --git a/hostmux/ChangeLog b/hostmux/ChangeLog index 202a5d84..1146f0b5 100644 --- a/hostmux/ChangeLog +++ b/hostmux/ChangeLog @@ -1,3 +1,8 @@ +Sun Jan 31 18:34:59 1999 Thomas Bushnell, BSG <tb@mit.edu> + + * node.c (netfs_attempt_utimes): Implement new possibility that + ATIME or MTIME might be null. + 1997-08-27 Miles Bader <miles@gnu.ai.mit.edu> * mux.c (netfs_attempt_lookup): Clear *NODE on errors. diff --git a/hostmux/node.c b/hostmux/node.c index 0fedf8c2..3576af90 100644 --- a/hostmux/node.c +++ b/hostmux/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. @@ -72,13 +72,27 @@ 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; - fshelp_touch (&node->nn_stat, TOUCH_CTIME, hostmux_maptime); + 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, flags, hostmux_maptime); } return err; } |