diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2000-09-21 11:11:43 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2000-09-21 11:11:43 +0000 |
commit | 0d0ffcc9b6eb172b5be2569af0812b5e6c3cf0d4 (patch) | |
tree | 26c609b8e9b0b992584fdddfec40c040355cd8d9 /usr.bin | |
parent | 4b800afab3eb1c157df308a27696e518898c2ee5 (diff) |
utime() to utimes(); mouring@pconline.com
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/scp.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index ec1f3d1f44d..47edc5cab11 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -75,11 +75,10 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.39 2000/09/07 20:53:00 markus Exp $"); +RCSID("$OpenBSD: scp.c,v 1.40 2000/09/21 11:11:42 markus Exp $"); #include "ssh.h" #include "xmalloc.h" -#include <utime.h> #define _PATH_CP "cp" @@ -703,8 +702,8 @@ sink(argc, argv) off_t size; int setimes, targisdir, wrerrno = 0; char ch, *cp, *np, *targ, *why, *vect[1], buf[2048]; - struct utimbuf ut; int dummy_usec; + struct timeval tv[2]; #define SCREWUP(str) { why = str; goto screwup; } @@ -758,16 +757,18 @@ sink(argc, argv) if (*cp == 'T') { setimes++; cp++; - getnum(ut.modtime); + getnum(tv[1].tv_sec); if (*cp++ != ' ') SCREWUP("mtime.sec not delimited"); getnum(dummy_usec); + tv[1].tv_usec = 0; if (*cp++ != ' ') SCREWUP("mtime.usec not delimited"); - getnum(ut.actime); + getnum(tv[0].tv_sec); if (*cp++ != ' ') SCREWUP("atime.sec not delimited"); getnum(dummy_usec); + tv[0].tv_usec = 0; if (*cp++ != '\0') SCREWUP("atime.usec not delimited"); (void) atomicio(write, remout, "", 1); @@ -835,7 +836,7 @@ sink(argc, argv) sink(1, vect); if (setimes) { setimes = 0; - if (utime(np, &ut) < 0) + if (utimes(np, tv) < 0) run_err("%s: set times: %s", np, strerror(errno)); } @@ -922,7 +923,7 @@ bad: run_err("%s: %s", np, strerror(errno)); (void) response(); if (setimes && wrerr == NO) { setimes = 0; - if (utime(np, &ut) < 0) { + if (utimes(np, tv) < 0) { run_err("%s: set times: %s", np, strerror(errno)); wrerr = DISPLAYED; |