summaryrefslogtreecommitdiffstats
path: root/misc-utils/hardlink.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
commit1272be04be0cb803eec87f602edb2e3e6f111aea (patch)
treebce17f6478cdd9f3c4ec3d751135dc42786d6a56 /misc-utils/hardlink.c
parentReleasing progress-linux version 2.39.3-11~progress7.99u1. (diff)
downloadutil-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.tar.xz
util-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.zip
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--misc-utils/hardlink.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/misc-utils/hardlink.c b/misc-utils/hardlink.c
index 7e66dfd..f9d3d09 100644
--- a/misc-utils/hardlink.c
+++ b/misc-utils/hardlink.c
@@ -991,7 +991,8 @@ static int is_reflink(struct file *xa, struct file *xb)
if (ioctl(bf, FS_IOC_FIEMAP, (unsigned long) bmap) < 0)
goto done;
- if (amap->fm_mapped_extents != bmap->fm_mapped_extents)
+ if (amap->fm_mapped_extents == 0 ||
+ amap->fm_mapped_extents != bmap->fm_mapped_extents)
goto done;
for (i = 0; i < amap->fm_mapped_extents; i++) {
@@ -1192,8 +1193,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" --skip-reflinks skip already cloned files (enabled on --reflink)\n"), out);
#endif
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(28));
- printf(USAGE_MAN_TAIL("hardlink(1)"));
+ fprintf(out, USAGE_HELP_OPTIONS(28));
+ fprintf(out, USAGE_MAN_TAIL("hardlink(1)"));
exit(EXIT_SUCCESS);
}