Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.

Commit d1dedab

Browse files
refactor(packages/btrfs-progs): clean up error messages in dump-csum patch
1 parent 64bdd20 commit d1dedab

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/btrfs-progs/dump-csum.patch

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ index c19e664a..8d491c8f 100644
4949
DECLARE_COMMAND(send);
5050
diff --git a/cmds/inspect-dump-csum.c b/cmds/inspect-dump-csum.c
5151
new file mode 100644
52-
index 00000000..8e607e51
52+
index 00000000..4597ebf6
5353
--- /dev/null
5454
+++ b/cmds/inspect-dump-csum.c
55-
@@ -0,0 +1,243 @@
55+
@@ -0,0 +1,244 @@
5656
+/*
5757
+ * Copyright (C) 2019 SUSE. All rights reserved.
5858
+ *
@@ -223,7 +223,7 @@ index 00000000..8e607e51
223223
+}
224224
+
225225
+static const char * const cmd_inspect_dump_csum_usage[] = {
226-
+ "btrfs inspect-internal dump-csum <path> <device>",
226+
+ "btrfs inspect-internal dump-csum <file> <device>",
227227
+ "Dump checksums for a given file",
228228
+ "",
229229
+ OPTLINE("-d|--debug", "Be more verbose"),
@@ -269,13 +269,13 @@ index 00000000..8e607e51
269269
+
270270
+ fd = open(filename, O_RDONLY);
271271
+ if (fd < 0) {
272-
+ error("cannot open file %s: %m", filename);
272+
+ error("couldn't open file %s: %m", filename);
273273
+ return -errno;
274274
+ }
275275
+
276276
+ devfd = open(device, O_RDONLY);
277277
+ if (devfd < 0) {
278-
+ error("cannot open device %s: %m", device);
278+
+ error("couldn't open device %s: %m", device);
279279
+ ret = -errno;
280280
+ goto out_close;
281281
+ }
@@ -284,13 +284,14 @@ index 00000000..8e607e51
284284
+
285285
+ if (btrfs_super_magic(&sb) != BTRFS_MAGIC) {
286286
+ ret = -EINVAL;
287-
+ error("bad magic on superblock on %s", device);
287+
+ error("bad superblock magic on %s", device);
288288
+ goto out_close;
289289
+ }
290290
+
291291
+ ret = btrfs_get_extent_csum(fd, &sb);
292292
+ if (ret)
293-
+ error("checsum lookup for file %s failed", filename);
293+
+ error("checksum lookup for file %s failed", filename);
294+
+
294295
+out_close:
295296
+ close(fd);
296297
+ return ret;

0 commit comments

Comments
 (0)