diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2005-06-30 15:13:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2005-06-30 15:13:25 +0000 |
commit | c6da3bc91e1781469eb8b88e63e5c609214ef2fc (patch) | |
tree | 02f11d6e4b9feaf2c89565d7c71a827272957a03 | |
parent | 420b69eb5195bebefcd9cb2df96c23ff1ee0602b (diff) |
Set tv_usec sensibly when calling utimes() instead of just zeroing it.
We have nsec file times so we may as well use them...
-rw-r--r-- | bin/mv/mv.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 37194d8f9a4..8c905dd36d4 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mv.c,v 1.31 2005/04/08 20:09:36 jaredy Exp $ */ +/* $OpenBSD: mv.c,v 1.32 2005/06/30 15:13:24 millert Exp $ */ /* $NetBSD: mv.c,v 1.9 1995/03/21 09:06:52 cgd Exp $ */ /* @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: mv.c,v 1.31 2005/04/08 20:09:36 jaredy Exp $"; +static char rcsid[] = "$OpenBSD: mv.c,v 1.32 2005/06/30 15:13:24 millert Exp $"; #endif #endif /* not lint */ @@ -333,9 +333,8 @@ err: if (unlink(to)) if (errno != EOPNOTSUPP || sbp->st_flags != 0) warn("%s: set flags", to); - tval[0].tv_sec = sbp->st_atime; - tval[1].tv_sec = sbp->st_mtime; - tval[0].tv_usec = tval[1].tv_usec = 0; + TIMESPEC_TO_TIMEVAL(&tval[0], &sbp->st_atimespec); + TIMESPEC_TO_TIMEVAL(&tval[1], &sbp->st_mtimespec); if (utimes(to, tval)) warn("%s: set times", to); |