diff options
author | 2005-06-30 15:13:24 +0000 | |
---|---|---|
committer | 2005-06-30 15:13:24 +0000 | |
commit | 596e3b01ff34546bc7828eaeca8dbfb4883e08cb (patch) | |
tree | ea493ff7514eeb2a87a31fae16f9f623a1685fc3 | |
parent | one ioctl has to be first since it tells what the hell others use (diff) | |
download | wireguard-openbsd-596e3b01ff34546bc7828eaeca8dbfb4883e08cb.tar.xz wireguard-openbsd-596e3b01ff34546bc7828eaeca8dbfb4883e08cb.zip |
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); |