summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-08-22 19:14:20 +0200
committerDavid Sterba <dsterba@suse.com>2016-08-24 14:37:36 +0200
commite44415f7134e4b2a9eba403194940260ceecc0f6 (patch)
tree680513e264a84a0b430d5a011b59b871875070e7 /mkfs.c
parente1c851470567892ba2a8a734b2eb6921673ce875 (diff)
btrfs-progs: mkfs: clean up make_image
The exact errors are printed, the removed message does not seem to be necessary. Return proper errors. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mkfs.c b/mkfs.c
index ef0b099a..2aa1d5d3 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1042,16 +1042,14 @@ static int make_image(char *source_dir, struct btrfs_root *root, int out_fd)
{
int ret;
struct btrfs_trans_handle *trans;
-
struct stat root_st;
-
struct directory_name_entry dir_head;
-
struct directory_name_entry *dir_entry = NULL;
ret = lstat(source_dir, &root_st);
if (ret) {
error("unable to lstat %s: %s", source_dir, strerror(errno));
+ ret = -errno;
goto out;
}
@@ -1080,8 +1078,7 @@ fail:
free(dir_entry);
}
out:
- fprintf(stderr, "Making image is aborted.\n");
- return -1;
+ return ret;
}
/*