summaryrefslogtreecommitdiff
path: root/libnetfs/file-utimes.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-01-31 23:49:56 +0000
committerThomas Bushnell <thomas@gnu.org>1999-01-31 23:49:56 +0000
commiteef100d3e42e30b98b2218a102d98841e2e5e41f (patch)
treeca3a541bd3a9d361fafef569a9a95c0a12336fed /libnetfs/file-utimes.c
parente5b20b2e303e29c99192846d550df4532410688e (diff)
Sun Jan 31 18:27:42 1999 Thomas Bushnell, BSG <tb@mit.edu>
* file-utimes.c (netfs_S_file_utimes): Understand new semantics for setting to current time. * netfs.h (netfs_attempt_utimes): Update documentation.
Diffstat (limited to 'libnetfs/file-utimes.c')
-rw-r--r--libnetfs/file-utimes.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/libnetfs/file-utimes.c b/libnetfs/file-utimes.c
index abe2f6c4..45adf825 100644
--- a/libnetfs/file-utimes.c
+++ b/libnetfs/file-utimes.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
This file is part of the GNU Hurd.
@@ -28,17 +28,26 @@ netfs_S_file_utimes (struct protid *user,
{
struct timespec atime, mtime;
error_t err;
+
+ if (atimein.microseconds != -1)
+ {
+ atime.tv_sec = atimein.seconds;
+ atime.tv_nsec = atimein.microseconds * 1000;
+ }
- atime.tv_sec = atimein.seconds;
- atime.tv_nsec = atimein.microseconds * 1000;
- mtime.tv_sec = mtimein.seconds;
- mtime.tv_nsec = mtimein.microseconds * 1000;
+ if (mtimein.microseconds != -1)
+ {
+ mtime.tv_sec = mtimein.seconds;
+ mtime.tv_nsec = mtimein.microseconds * 1000;
+ }
if (!user)
return EOPNOTSUPP;
mutex_lock (&user->po->np->lock);
- err = netfs_attempt_utimes (user->user, user->po->np, &atime, &mtime);
+ err = netfs_attempt_utimes (user->user, user->po->np,
+ atimein.microseconds != -1 ? &atime : 0,
+ mtimein.microseconds != -1 ? &mtime : 0);
mutex_unlock (&user->po->np->lock);
return err;
}