summaryrefslogtreecommitdiff
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 5a446c1a..a8395aac 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -136,7 +136,8 @@ static int cmd_subvol_create(int argc, char **argv)
retval = 1; /* failure */
res = test_isdir(dst);
if (res < 0 && res != -ENOENT) {
- error("cannot access %s: %s", dst, strerror(-res));
+ errno = -res;
+ error("cannot access %s: %m", dst);
goto out;
}
if (res >= 0) {
@@ -337,8 +338,8 @@ again:
} else if (commit_mode == COMMIT_AFTER) {
res = get_fsid(dname, fsid, 0);
if (res < 0) {
- error("unable to get fsid for '%s': %s",
- path, strerror(-res));
+ errno = -res;
+ error("unable to get fsid for '%s': %m", path);
error(
"delete succeeded but commit may not be done in the end");
ret = 1;
@@ -690,7 +691,8 @@ static int cmd_subvol_snapshot(int argc, char **argv)
res = test_isdir(dst);
if (res < 0 && res != -ENOENT) {
- error("cannot access %s: %s", dst, strerror(-res));
+ errno = -res;
+ error("cannot access %s: %m", dst);
goto out;
}
if (res == 0) {