summaryrefslogtreecommitdiffstats
path: root/scp.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-08-13 13:19:37 +0200
committerDarren Tucker <dtucker@zip.com.au>2004-08-13 13:19:37 +0200
commitfe6649da0cd211efc069aa9987b00838d030ef1d (patch)
tree88a21d6391c047fbf32ed9c50b9a7594978e0599 /scp.c
parent - avsm@cvs.openbsd.org 2004/08/11 21:43:05 (diff)
downloadopenssh-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.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/scp.c b/scp.c
index 33c5891f2..ef9eaa1a4 100644
--- a/scp.c
+++ b/scp.c
@@ -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);