From: Jim Meyering Date: Wed, 3 Apr 1996 12:20:24 +0000 (+0000) Subject: (copy_reg): Use `ST_NBLOCKS (sb) * 512', not `sb.st_blocks * X-Git-Tag: TEXTUTILS-1_14b~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3191649a85a127d3112ddae1d893346caeec982a;p=thirdparty%2Fcoreutils.git (copy_reg): Use `ST_NBLOCKS (sb) * 512', not `sb.st_blocks * DEV_BSIZE.' From H.J. Lu (hjl@lucon.org). --- diff --git a/src/cp.c b/src/cp.c index bb03ff6ae1..a44046abed 100644 --- a/src/cp.c +++ b/src/cp.c @@ -1242,7 +1242,7 @@ copy_reg (char *src_path, char *dst_path) be needed for a file of its size, then at least one of the blocks in the file is a hole. */ /* FIXME: isn't there risk of overflow here? */ - if (S_ISREG (sb.st_mode) && sb.st_size > sb.st_blocks * DEV_BSIZE) + if (S_ISREG (sb.st_mode) && sb.st_size > ST_NBLOCKS (sb) * 512) make_holes = 1; } #endif