Thread (16 messages) 16 messages, 2 authors, 2016-08-24
STALE3603d

[PATCH 13/13] btrfs-progs: mkfs: clean up make_image

From: David Sterba <dsterba@suse.com>
Date: 2016-08-23 10:43:45
Subsystem: the rest · Maintainer: Linus Torvalds

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>
---
 mkfs.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/mkfs.c b/mkfs.c
index ef0b099a58d7..2aa1d5d31523 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 @@ static int make_image(char *source_dir, struct btrfs_root *root, int out_fd)
 		free(dir_entry);
 	}
 out:
-	fprintf(stderr, "Making image is aborted.\n");
-	return -1;
+	return ret;
 }
 
 /*
-- 
2.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help