summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2002-12-05 11:08:36 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2002-12-05 11:08:36 +0000
commit1f7ca55a4c9609efde7b135cf6434600e3423ddb (patch)
tree8a0a1586d390184990ce49abba28db12f74f322b /usr.bin
parent287f5cb4847b29a59e64e9e30aa7c39918a72a61 (diff)
use roundup() similar to rcp/util.c and avoid problems with strange
filesystem block sizes, noted by tjr@freebsd.org; ok djm@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/scp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c
index 151e982a839..0f23b88e224 100644
--- a/usr.bin/ssh/scp.c
+++ b/usr.bin/ssh/scp.c
@@ -75,7 +75,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.94 2002/11/27 17:53:35 markus Exp $");
+RCSID("$OpenBSD: scp.c,v 1.95 2002/12/05 11:08:35 markus Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -1031,11 +1031,9 @@ allocbuf(bp, fd, blksize)
run_err("fstat: %s", strerror(errno));
return (0);
}
- if (stb.st_blksize == 0)
+ size = roundup(stb.st_blksize, blksize);
+ if (size == 0)
size = blksize;
- else
- size = blksize + (stb.st_blksize - blksize % stb.st_blksize) %
- stb.st_blksize;
if (bp->cnt >= size)
return (bp);
if (bp->buf == NULL)