diff options
author | Zach Brown <zab@redhat.com> | 2013-01-21 17:11:28 -0800 |
---|---|---|
committer | Zach Brown <zab@redhat.com> | 2013-02-05 16:09:39 -0800 |
commit | ac59571f59d1d87b9c7d2cab8cf8d54f578d639e (patch) | |
tree | 8436abe295effd5c02a45cd7d9f06e37f26a52be | |
parent | da3a185f445957787db25a4a33e8992e634e2c37 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |