diff options
-rw-r--r-- | cmds-receive.c | 5 | ||||
-rw-r--r-- | cmds-send.c | 5 | ||||
-rw-r--r-- | utils.c | 6 |
3 files changed, 7 insertions, 9 deletions
diff --git a/cmds-receive.c b/cmds-receive.c index 87dc1b4e..20b3db09 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -842,9 +842,10 @@ static int do_receive(struct btrfs_receive *r, const char *tomnt, int r_fd, ret = find_mount_root(dest_dir_full_path, &r->root_path); if (ret < 0) { + fprintf(stderr, + "ERROR: failed to determine mount point for %s: %s\n", + dest_dir_full_path, strerror(-ret)); ret = -EINVAL; - fprintf(stderr, "ERROR: failed to determine mount point " - "for %s\n", dest_dir_full_path); goto out; } r->mnt_fd = open(r->root_path, O_RDONLY | O_NOATIME); diff --git a/cmds-send.c b/cmds-send.c index 0e5bb544..9ec52dcd 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -349,9 +349,10 @@ static int init_root_path(struct btrfs_send *s, const char *subvol) ret = find_mount_root(subvol, &s->root_path); if (ret < 0) { + fprintf(stderr, + "ERROR: failed to determine mount point for %s: %s\n", + subvol, strerror(-ret)); ret = -EINVAL; - fprintf(stderr, "ERROR: failed to determine mount point " - "for %s\n", subvol); goto out; } @@ -2356,12 +2356,8 @@ int find_mount_root(const char *path, char **mount_root) } endmntent(mnttab); - if (!longest_match) { - fprintf(stderr, - "ERROR: Failed to find mount root for path %s.\n", - path); + if (!longest_match) return -ENOENT; - } ret = 0; *mount_root = realpath(longest_match, NULL); |