diff options
author | mouring <mouring> | 2001-06-05 19:31:41 +0000 |
---|---|---|
committer | mouring <mouring> | 2001-06-05 19:31:41 +0000 |
commit | 7801411c65264952cf20e7ab69906936cb3b1603 (patch) | |
tree | 1f443838318e7b4cb60078fb1d10ec540ea7c297 /scp.c | |
parent | 7ab30547ebba95bec07823b4da63b2ae9ea13461 (diff) | |
download | openssh-7801411c65264952cf20e7ab69906936cb3b1603.tar.gz |
- markus@cvs.openbsd.org 2001/05/19 16:05:41
[scp.c]
ftruncate() instead of open()+O_TRUNC like rcp.c does
allows scp /path/to/file localhost:/path/to/file
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -75,7 +75,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.70 2001/05/08 19:45:24 mouring Exp $"); +RCSID("$OpenBSD: scp.c,v 1.71 2001/05/19 16:05:41 markus Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -804,7 +804,7 @@ sink(argc, argv) } omode = mode; mode |= S_IWRITE; - if ((ofd = open(np, O_WRONLY | O_CREAT | O_TRUNC, mode)) < 0) { + if ((ofd = open(np, O_WRONLY|O_CREAT, mode)) < 0) { bad: run_err("%s: %s", np, strerror(errno)); continue; } @@ -859,12 +859,10 @@ bad: run_err("%s: %s", np, strerror(errno)); wrerr = YES; wrerrno = j >= 0 ? EIO : errno; } -#if 0 if (ftruncate(ofd, size)) { run_err("%s: truncate: %s", np, strerror(errno)); wrerr = DISPLAYED; } -#endif if (pflag) { if (exists || omode != mode) #ifdef HAVE_FCHMOD |