- Fix init handler call: call it after default handlers setup.

This commit is contained in:
Arnaud G. GIBERT 2024-05-28 13:59:18 +02:00
parent c45466c893
commit 6d13e890a9
2 changed files with 9 additions and 10 deletions

View File

@ -1004,14 +1004,6 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_DataStruct_Name
} }
/* Call init function */
if( ( status = ND_Handler_Init_Exec_I( &root_extra_size, handler_target_tab, handler_target_tab[ NDD_HANDLER_ID_INIT].Name, ( NDT_Handler_Init *)handler_target_tab[ NDD_HANDLER_ID_INIT].Ptr, User_Ptr)) != NDS_OK)
{
return( status);
}
/* Complete with default handlers */ /* Complete with default handlers */
for( handler_id = 0; handler_id < NDD_HANDLER_ID_NB; handler_id++) for( handler_id = 0; handler_id < NDD_HANDLER_ID_NB; handler_id++)
@ -1022,6 +1014,13 @@ NDT_Status ND_DataStruct_Open_I( NDT_Root **Root_Ptr_Ptr, NDT_DataStruct_Name
} }
} }
/* Call init function */
if( ( status = ND_Handler_Init_Exec_I( &root_extra_size, handler_target_tab, handler_target_tab[ NDD_HANDLER_ID_INIT].Name, ( NDT_Handler_Init *)handler_target_tab[ NDD_HANDLER_ID_INIT].Ptr, User_Ptr)) != NDS_OK)
{
return( status);
}
if( ( status = ND_Node_Root_Alloc( Root_Ptr_Ptr, Name, Index_Nb, Type_Ptr, handler_target_tab, root_extra_size, Own_Value, User_Ptr)) != NDS_OK) if( ( status = ND_Node_Root_Alloc( Root_Ptr_Ptr, Name, Index_Nb, Type_Ptr, handler_target_tab, root_extra_size, Own_Value, User_Ptr)) != NDS_OK)

View File

@ -503,8 +503,8 @@ NDT_Handler NDG_Handler_Tab_Default[ NDD_HANDLER_NB] =
( NDT_Handler_Function *)ND_Handler_Open_Default}, /* Default Open function pointer */ ( NDT_Handler_Function *)ND_Handler_Open_Default}, /* Default Open function pointer */
{ "NDT_Handler_Close_Default", /* Default Close function name */ { "NDT_Handler_Close_Default", /* Default Close function name */
( NDT_Handler_Function *)ND_Handler_Close_Default}, /* Default Close function pointer */ ( NDT_Handler_Function *)ND_Handler_Close_Default}, /* Default Close function pointer */
{ "NDT_Handler_Info_Default", /* Default Lock function name */ { "NDT_Handler_Info_Default", /* Default Info function name */
( NDT_Handler_Function *)ND_Handler_Info_Default}, /* Default Lock function pointer */ ( NDT_Handler_Function *)ND_Handler_Info_Default}, /* Default Info function pointer */
{ "NDT_Handler_Lock_Default", /* Default Lock function name */ { "NDT_Handler_Lock_Default", /* Default Lock function name */
( NDT_Handler_Function *)ND_Handler_Lock_Default}, /* Default Lock function pointer */ ( NDT_Handler_Function *)ND_Handler_Lock_Default}, /* Default Lock function pointer */
{ "NDT_Handler_Unlock_Default", /* Default Unlock function name */ { "NDT_Handler_Unlock_Default", /* Default Unlock function name */