mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-11 04:18:02 +00:00
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>
This commit is contained in:
parent
da3a185f44
commit
ac59571f59
2
mkfs.c
2
mkfs.c
@ -782,7 +782,7 @@ static int add_file_items(struct btrfs_trans_handle *trans,
|
|||||||
fd = open(path_name, O_RDONLY);
|
fd = open(path_name, O_RDONLY);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
fprintf(stderr, "%s open failed\n", path_name);
|
fprintf(stderr, "%s open failed\n", path_name);
|
||||||
goto end;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
blocks = st->st_size / sectorsize;
|
blocks = st->st_size / sectorsize;
|
||||||
|
Loading…
Reference in New Issue
Block a user