1.2pre17 scp Input/Output error

Damien Miller djm at mindrot.org
Wed Dec 15 09:31:45 EST 1999


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 14 Dec 1999, Berend De Schouwer wrote:

> Under OpenSSH 1.2pre17 I can duplicate and Input/Output error for scp:

Does the attached patch sole your problems?

Thanks for the report.

Damien 

- --
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE4VsVVormJ9RG1dI8RAsl6AKCmc/67Z9s5vGxpRxakfoxc7mDulwCghByS
xcT+G0f9yFT7JjtjPyzNI4M=
=uYXx
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: scp.c
===================================================================
RCS file: /var/cvs/openssh/scp.c,v
retrieving revision 1.12
diff -u -r1.12 scp.c
--- scp.c	1999/12/07 04:38:32	1.12
+++ scp.c	1999/12/14 22:27:10
@@ -541,14 +541,14 @@
 			if (i + amt > stb.st_size)
 				amt = stb.st_size - i;
 			if (!haderr) {
-				result = read(fd, bp->buf, amt);
+				result = atomicio(read, fd, bp->buf, amt);
 				if (result != amt)
 					haderr = result >= 0 ? EIO : errno;
 			}
 			if (haderr)
-				(void) write(remout, bp->buf, amt);
+				(void) atomicio(write, remout, bp->buf, amt);
 			else {
-				result = write(remout, bp->buf, amt);
+				result = atomicio(write, remout, bp->buf, amt);
 				if (result != amt)
 					haderr = result >= 0 ? EIO : errno;
 				statbytes += result;
@@ -1145,9 +1145,8 @@
 		i++;
 		abbrevsize >>= 10;
 	}
-	snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %5qd %c%c ",
-	     (quad_t) abbrevsize, prefixes[i], prefixes[i] == ' ' ? ' ' :
-		 'B');
+	snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %5d %c%c ",
+	     (int) abbrevsize, prefixes[i], prefixes[i] == ' ' ? ' ' : 'B');
 
 	timersub(&now, &lastupdate, &wait);
 	if (cursize > lastsize) {


More information about the openssh-unix-dev mailing list