libnbd/0004-copy-Print-program-nam...

41 lines
1.4 KiB
Diff

From eb49c1d99d021ed1d2389eda4c8db4be89cef6c1 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 27 Jun 2022 16:17:14 +0100
Subject: [PATCH] copy: Print program name in some error messages
Updates: commit 8d444b41d09a700c7ee6f9182a649f3f2d325abb
(cherry picked from commit fb187e0eb9bad74e826289bc4ca421d8c4db2e79)
---
copy/multi-thread-copying.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/copy/multi-thread-copying.c b/copy/multi-thread-copying.c
index afcbe32..06cdb8e 100644
--- a/copy/multi-thread-copying.c
+++ b/copy/multi-thread-copying.c
@@ -429,8 +429,8 @@ finished_read (void *vp, int *error)
struct command *command = vp;
if (*error) {
- fprintf (stderr, "read at offset %" PRId64 " failed: %s\n",
- command->offset, strerror (*error));
+ fprintf (stderr, "%s: read at offset %" PRId64 " failed: %s\n",
+ prog, command->offset, strerror (*error));
exit (EXIT_FAILURE);
}
@@ -606,8 +606,8 @@ finished_command (void *vp, int *error)
struct command *command = vp;
if (*error) {
- fprintf (stderr, "write at offset %" PRId64 " failed: %s\n",
- command->offset, strerror (*error));
+ fprintf (stderr, "%s: write at offset %" PRId64 " failed: %s\n",
+ prog, command->offset, strerror (*error));
exit (EXIT_FAILURE);
}
--
2.31.1