]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
copyfilerange: use err() instead of errx() with glibc %m
authorKarel Zak <kzak@redhat.com>
Mon, 27 Apr 2026 08:32:06 +0000 (10:32 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 27 Apr 2026 08:32:06 +0000 (10:32 +0200)
Replace errx() + %m format specifier with err(), which portably
appends strerror(errno) without relying on the glibc-specific %m
extension.

Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/copyfilerange.c

index 5bf700f976b7c4b309cdcb7beaac2568af4e989b..9bfbe4b2b1d9bfb84b553ff82d4eaad6165c87d4 100644 (file)
@@ -147,8 +147,8 @@ static void copy_range(struct rangeitem *range) {
                const ssize_t copied = copy_file_range(range->in_fd, &range->in_offset,
                                                range->out_fd, &range->out_offset, chunk, 0);
                if (copied < 0)
-                       errx(EXIT_FAILURE, _("failed to copy range %jd:%jd:%ju "
-                                               "from %s to %s with %ju remaining: %m"),
+                       err(EXIT_FAILURE, _("failed to copy range %jd:%jd:%ju "
+                                               "from %s to %s with %ju remaining"),
                                                (intmax_t) range->in_offset, (intmax_t) range->out_offset,
                                                                range->length, range->in_filename,
                                                                range->out_filename, remaining);