summaryrefslogtreecommitdiff
path: root/usr/src/cmd/ssh/scp/scp.c
diff options
context:
space:
mode:
authorjp161948 <none@none>2006-08-28 11:34:02 -0700
committerjp161948 <none@none>2006-08-28 11:34:02 -0700
commit12fcfd5af4d13749fc322b29438543787680068b (patch)
tree8d9f841a681b8de2a30185d273947904edf5293b /usr/src/cmd/ssh/scp/scp.c
parent742e7b7f67598e6aa656a0b21427a1e017a7143e (diff)
downloadillumos-gate-12fcfd5af4d13749fc322b29438543787680068b.tar.gz
6460128 sshd changes locale from ISO8859-1 to UTF-8
6460274 scp fails sometimes if target filesystem is ZFS
Diffstat (limited to 'usr/src/cmd/ssh/scp/scp.c')
-rw-r--r--usr/src/cmd/ssh/scp/scp.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/usr/src/cmd/ssh/scp/scp.c b/usr/src/cmd/ssh/scp/scp.c
index 190e18e22c..4290bae3d5 100644
--- a/usr/src/cmd/ssh/scp/scp.c
+++ b/usr/src/cmd/ssh/scp/scp.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
@@ -861,7 +861,6 @@ bad: run_err("%s: %s", np, strerror(errno));
(void) close(ofd);
continue;
}
- cp = bp->buf;
wrerr = NO;
if (showprogress) {
@@ -869,11 +868,12 @@ bad: run_err("%s: %s", np, strerror(errno));
progressmeter(-1);
}
statbytes = 0;
- for (count = i = 0; i < size; i += 4096) {
- amt = 4096;
+ for (i = 0; i < size; i += bp->cnt) {
+ amt = bp->cnt;
+ cp = bp->buf;
if (i + amt > size)
amt = size - i;
- count += amt;
+ count = amt;
do {
j = read(remin, cp, amt);
if (j == -1 && (errno == EINTR ||
@@ -888,18 +888,14 @@ bad: run_err("%s: %s", np, strerror(errno));
cp += j;
statbytes += j;
} while (amt > 0);
- if (count == bp->cnt) {
- /* Keep reading so we stay sync'd up. */
- if (wrerr == NO) {
- j = atomicio(write, ofd, bp->buf,
- count);
- if (j != count) {
- wrerr = YES;
- wrerrno = j >= 0 ? EIO : errno;
- }
+ /* Keep reading so we stay sync'd up. */
+ if (wrerr == NO) {
+ j = atomicio(write, ofd, bp->buf,
+ count);
+ if (j != count) {
+ wrerr = YES;
+ wrerrno = j >= 0 ? EIO : errno;
}
- count = 0;
- cp = bp->buf;
}
}
if (showprogress)