File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
cube/swiss/source/devices/fsp Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -226,19 +226,24 @@ s32 deviceHandler_FSP_init(file_handle* file) {
226226 file -> status = E_CHECKCONFIG ;
227227 return EFAULT ;
228228 }
229+ fsp_session -> timeout = 10000 ;
229230
230- u8 dirpro ;
231- if ( fsp_getpro ( fsp_session , "swiss/patches" , & dirpro ) &&
232- fsp_getpro (fsp_session , "swiss" , & dirpro ) &&
233- fsp_getpro (fsp_session , "" , & dirpro ))
234- dirpro = 0 ;
231+ u8 dirpro = 0 ;
232+ int ret ;
233+ if (( ret = fsp_getpro (fsp_session , "swiss/patches " , & dirpro )) == -1 && errno == ENOENT &&
234+ ( ret = fsp_getpro (fsp_session , "swiss " , & dirpro )) == -1 && errno == ENOENT )
235+ ret = fsp_getpro ( fsp_session , "" , & dirpro ) ;
235236
236- if ((dirpro & (FSP_DIR_MKDIR |FSP_DIR_ADD |FSP_DIR_DEL |FSP_DIR_GET )) == (FSP_DIR_MKDIR |FSP_DIR_ADD |FSP_DIR_DEL ) ||
237+ if (ret == -1 && errno != ENOENT ) {
238+ file -> status = 0 ;
239+ return errno ;
240+ }
241+
242+ if ((dirpro & (FSP_DIR_MKDIR | FSP_DIR_ADD | FSP_DIR_DEL | FSP_DIR_GET )) == (FSP_DIR_MKDIR | FSP_DIR_ADD | FSP_DIR_DEL ) ||
237243 (dirpro & FSP_DIR_OWNER )) {
238244 file -> device -> features |= FEAT_PATCHES ;
239245 file -> device -> emulable |= EMU_ETHERNET ;
240- }
241- else {
246+ } else {
242247 file -> device -> features &= ~FEAT_PATCHES ;
243248 file -> device -> emulable &= ~EMU_ETHERNET ;
244249 }
You can’t perform that action at this time.
0 commit comments