1
0
Fork 0
forked from Miroirs/x49gp

try loading boot firmware from opt.datadir also

This commit is contained in:
Gwenhael Le Moine 2024-11-14 15:29:15 +01:00
parent 08271cf4c2
commit f98bc7fea7
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -383,6 +383,20 @@ int x49gp_module_open_rodata( x49gp_module_t* module, const char* name, char** p
fd = open( *path, O_RDONLY );
if ( fd < 0 && ( errno == EACCES || errno == ENOENT ) ) {
g_free( *path );
*path = g_build_filename( opt.datadir, name, NULL );
if ( opt.verbose )
fprintf( stderr, "reading %s\n", *path );
if ( NULL == *path ) {
fprintf( stderr, "%s: %s:%u: Out of memory\n", module->name, __FUNCTION__, __LINE__ );
return -ENOMEM;
}
fd = open( *path, O_RDONLY );
}
#ifdef X49GP_DATADIR
if ( fd < 0 && ( errno == EACCES || errno == ENOENT ) ) {
g_free( *path );