mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-05-31 09:11:10 +00:00
parent
b817232f16
commit
7f11a9bf5c
6 changed files with 42 additions and 33 deletions
|
@ -24,26 +24,14 @@
|
|||
|
||||
void *default_fopen(const char *path)
|
||||
{
|
||||
FILE* handle;
|
||||
const char* msg;
|
||||
FILE* handle = fluid_file_open(path, &msg);
|
||||
|
||||
if(!fluid_file_test(path, G_FILE_TEST_EXISTS))
|
||||
if(handle == NULL)
|
||||
{
|
||||
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Unable to load non-existent file. ('%s')", path);
|
||||
return NULL;
|
||||
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Failed to open '%s': %s", path, msg);
|
||||
}
|
||||
|
||||
if(!fluid_file_test(path, G_FILE_TEST_IS_REGULAR))
|
||||
{
|
||||
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Refusing to load non-regular file! ('%s')", path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if((handle = FLUID_FOPEN(path, "rb")) == NULL)
|
||||
{
|
||||
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Specified file does not exists or insufficient permissions to open it! ('%s')", path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue