summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Brown <zab@redhat.com>2013-01-21 17:11:28 -0800
committerZach Brown <zab@redhat.com>2013-02-05 16:09:39 -0800
commitac59571f59d1d87b9c7d2cab8cf8d54f578d639e (patch)
tree8436abe295effd5c02a45cd7d9f06e37f26a52be
parentda3a185f445957787db25a4a33e8992e634e2c37 (diff)
btrfs-progs: don't close(-1)
When opening the fd fails just return instead of taking the shared error path that tries to close() the fd. Signed-off-by: Zach Brown <zab@redhat.com>
-rw-r--r--mkfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mkfs.c b/mkfs.c
index 0eee8b51..0c9eebfe 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -782,7 +782,7 @@ static int add_file_items(struct btrfs_trans_handle *trans,
fd = open(path_name, O_RDONLY);
if (fd == -1) {
fprintf(stderr, "%s open failed\n", path_name);
- goto end;
+ return ret;
}
blocks = st->st_size / sectorsize;