diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-08-13 13:19:37 +0200 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-08-13 13:19:37 +0200 |
commit | fe6649da0cd211efc069aa9987b00838d030ef1d (patch) | |
tree | 88a21d6391c047fbf32ed9c50b9a7594978e0599 /scp.c | |
parent | - avsm@cvs.openbsd.org 2004/08/11 21:43:05 (diff) | |
download | openssh-fe6649da0cd211efc069aa9987b00838d030ef1d.tar.xz openssh-fe6649da0cd211efc069aa9987b00838d030ef1d.zip |
- avsm@cvs.openbsd.org 2004/08/11 21:44:32
[authfd.c scp.c ssh-keyscan.c]
use atomicio instead of homegrown equivalents or read/write.
markus@ ok
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -71,7 +71,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.116 2004/07/08 12:47:21 dtucker Exp $"); +RCSID("$OpenBSD: scp.c,v 1.117 2004/08/11 21:44:32 avsm Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -898,11 +898,8 @@ bad: run_err("%s: %s", np, strerror(errno)); amt = size - i; count += amt; do { - j = read(remin, cp, amt); - if (j == -1 && (errno == EINTR || - errno == EAGAIN)) { - continue; - } else if (j <= 0) { + j = atomicio(read, remin, cp, amt); + if (j <= 0) { run_err("%s", j ? strerror(errno) : "dropped connection"); exit(1); |