mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-07-04 03:26:37 +02:00
fs: fix fugue_dir_explore() error not propagating to open()
This commit is contained in:
parent
1e220af616
commit
542b4f0a81
2 changed files with 6 additions and 1 deletions
|
@ -118,7 +118,7 @@ void *fugue_dir_explore(char const *path)
|
||||||
if(rc < 0) {
|
if(rc < 0) {
|
||||||
if(rc != BFile_EntryNotFound)
|
if(rc != BFile_EntryNotFound)
|
||||||
errno = bfile_error_to_errno(rc);
|
errno = bfile_error_to_errno(rc);
|
||||||
goto end;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -148,6 +148,7 @@ void *fugue_dir_explore(char const *path)
|
||||||
|
|
||||||
alloc_failure:
|
alloc_failure:
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
|
error:
|
||||||
fugue_dir_close(dp);
|
fugue_dir_close(dp);
|
||||||
dp = NULL;
|
dp = NULL;
|
||||||
end:
|
end:
|
||||||
|
|
|
@ -63,6 +63,10 @@ int fugue_open(char const *path, int flags, GUNUSED mode_t mode)
|
||||||
/* If the entry is a directory, open it as such */
|
/* If the entry is a directory, open it as such */
|
||||||
if(type == BFile_Type_Directory) {
|
if(type == BFile_Type_Directory) {
|
||||||
void *dp = fugue_dir_explore(path);
|
void *dp = fugue_dir_explore(path);
|
||||||
|
if(!dp) {
|
||||||
|
rc = -1;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
fs_descriptor_t data = {
|
fs_descriptor_t data = {
|
||||||
.type = &fugue_dir_descriptor_type,
|
.type = &fugue_dir_descriptor_type,
|
||||||
.data = dp,
|
.data = dp,
|
||||||
|
|
Loading…
Add table
Reference in a new issue