btrfs-progs: image: Fix error output to show correct return value

We can easily get confusing error message like:
  ERROR: restore failed: Success

This is caused by wrong "%m" usage, as we normally use ret to indicate
error, without populating errno.

This patch will fix it by output the return value directly as normally
we have extra error message to show more meaning message than the return
value.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2019-07-04 14:10:55 +08:00 committed by David Sterba
parent 4dd66c7991
commit d216266340

View file

@ -2735,7 +2735,7 @@ int BOX_MAIN(image)(int argc, char *argv[])
0, target, multi_devices);
}
if (ret) {
error("%s failed: %m", (create) ? "create" : "restore");
error("%s failed: %d", (create) ? "create" : "restore", ret);
goto out;
}