diff options
author | Damien Miller <djm@mindrot.org> | 2003-01-10 11:44:48 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-01-10 11:44:48 +0100 |
commit | 86b781c179911d609bd0e3cfa3992f510cd56413 (patch) | |
tree | 1393ce990884738c92b908dda0b016332c5fa868 /scp.c | |
parent | - djm@cvs.openbsd.org 2003/01/10 08:48:15 (diff) | |
download | openssh-86b781c179911d609bd0e3cfa3992f510cd56413.tar.xz openssh-86b781c179911d609bd0e3cfa3992f510cd56413.zip |
- djm@cvs.openbsd.org 2003/01/10 10:29:35
[scp.c]
Don't ftruncate after write error, creating sparse files of
incorrect length
mindrot bug #403, reported by rusr@cup.hp.com; ok markus@
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -75,7 +75,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.97 2003/01/10 08:19:07 fgsch Exp $"); +RCSID("$OpenBSD: scp.c,v 1.98 2003/01/10 10:29:35 djm Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -864,7 +864,7 @@ bad: run_err("%s: %s", np, strerror(errno)); wrerr = YES; wrerrno = j >= 0 ? EIO : errno; } - if (ftruncate(ofd, size)) { + if (wrerr == NO && ftruncate(ofd, size) != 0) { run_err("%s: truncate: %s", np, strerror(errno)); wrerr = DISPLAYED; } |