summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-12-23 02:22:09 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-12-23 02:22:09 +0000
commit418e078378d078c6995742e3f95f7c22f3580fb1 (patch)
tree03c67f6ff951ded94634db8a12ffa9c375546f76 /scp.c
parent611797ed1533f14ac2c04a2531ad90615afa6174 (diff)
- markus@cvs.openbsd.org 2002/12/05 11:08:35
[scp.c] 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 'scp.c')
-rw-r--r--scp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/scp.c b/scp.c
index 4214e0c5..eb5f23e4 100644
--- a/scp.c
+++ b/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"
@@ -1058,11 +1058,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;
#else /* HAVE_STRUCT_STAT_ST_BLKSIZE */
size = blksize;
#endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */