summaryrefslogtreecommitdiff
path: root/src/cp.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-06-19 04:10:17 +0000
committerJim Meyering <jim@meyering.net>1996-06-19 04:10:17 +0000
commitfc05e2880326a94aa9cd1d17f828fbe9cc2413fd (patch)
tree0e30780a589f057478521c2d18af167703dc6544 /src/cp.c
parent0bbec4b26e565d917fbb791d5f6ae0b7374839c0 (diff)
downloadcoreutils-fc05e2880326a94aa9cd1d17f828fbe9cc2413fd.tar.xz
(copy_reg): Cast both sides of comparison to size_t to avoid warning
about `comparison between signed and unsigned' from gcc -Wall.
Diffstat (limited to 'src/cp.c')
-rw-r--r--src/cp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cp.c b/src/cp.c
index 3be494c06..f28056b8a 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -1254,7 +1254,8 @@ copy_reg (const char *src_path, const char *dst_path)
#ifdef HAVE_ST_BLOCKS
if (flag_sparse == SPARSE_AUTO && S_ISREG (sb.st_mode))
{
- /* Find out whether the file contains any sparse blocks. */
+ /* Use a heuristic to determine whether SRC_PATH contains any
+ sparse blocks. */
if (fstat (source_desc, &sb))
{
@@ -1266,7 +1267,8 @@ copy_reg (const char *src_path, const char *dst_path)
/* If the file has fewer blocks than would normally
be needed for a file of its size, then
at least one of the blocks in the file is a hole. */
- if (S_ISREG (sb.st_mode) && sb.st_size / 512 > ST_NBLOCKS (sb))
+ if (S_ISREG (sb.st_mode)
+ && (size_t) (sb.st_size / 512) > (size_t) ST_NBLOCKS (sb))
make_holes = 1;
}
#endif