UE/API/USER: remove fd from nas_user_t
This commit is contained in:
+10
-10
@@ -70,7 +70,7 @@ static void *_nas_network_mngr(void *);
|
||||
static int _nas_set_signal_handler(int signal, void (handler)(int));
|
||||
static void _nas_signal_handler(int signal);
|
||||
|
||||
static void _nas_clean(user_api_id_t *user_api_id, int usr_fd, int net_fd);
|
||||
static void _nas_clean(user_api_id_t *user_api_id, int net_fd);
|
||||
|
||||
uint8_t usim_test = 0;
|
||||
// FIXME user must be set up with right itti message instance
|
||||
@@ -126,7 +126,7 @@ int main(int argc, const char *argv[])
|
||||
*/
|
||||
if (network_api_initialize (nhost, nport) != RETURNok) {
|
||||
LOG_TRACE (ERROR, "UE-MAIN - network_api_initialize() failed");
|
||||
user_api_close (user_api_id, user_fd);
|
||||
user_api_close (user_api_id);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ int main(int argc, const char *argv[])
|
||||
if (pthread_create (&user_mngr, &attr, _nas_user_mngr, &user_fd) != 0) {
|
||||
LOG_TRACE (ERROR, "UE-MAIN - "
|
||||
"Failed to create the user management thread");
|
||||
user_api_close (user_api_id, user_fd);
|
||||
user_api_close (user_api_id);
|
||||
network_api_close (network_fd);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
@@ -177,7 +177,7 @@ int main(int argc, const char *argv[])
|
||||
&network_fd) != 0) {
|
||||
LOG_TRACE (ERROR, "UE-MAIN - "
|
||||
"Failed to create the network management thread");
|
||||
user_api_close (user_api_id, user_fd);
|
||||
user_api_close (user_api_id);
|
||||
network_api_close (network_fd);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
@@ -195,7 +195,7 @@ int main(int argc, const char *argv[])
|
||||
}
|
||||
|
||||
/* Termination cleanup */
|
||||
_nas_clean (user_api_id, user_fd, network_fd);
|
||||
_nas_clean (user_api_id, network_fd);
|
||||
|
||||
LOG_TRACE
|
||||
(WARNING, "UE-MAIN - NAS main process exited");
|
||||
@@ -236,7 +236,7 @@ static void *_nas_user_mngr(void *args)
|
||||
}
|
||||
|
||||
/* Close the connection to the user application layer */
|
||||
user_api_close (user->user_api_id, *fd);
|
||||
user_api_close (user->user_api_id);
|
||||
LOG_TRACE (WARNING, "UE-MAIN - "
|
||||
"The user connection endpoint manager exited");
|
||||
|
||||
@@ -386,7 +386,7 @@ static void _nas_signal_handler(int signal)
|
||||
|
||||
LOG_TRACE (WARNING, "UE-MAIN - Signal %d received", signal);
|
||||
// FIXME acces to global
|
||||
_nas_clean (user->user_api_id, user_api_get_fd (user->user_api_id), network_api_get_fd ());
|
||||
_nas_clean (user->user_api_id, network_api_get_fd ());
|
||||
exit (EXIT_SUCCESS);
|
||||
|
||||
LOG_FUNC_OUT
|
||||
@@ -407,7 +407,7 @@ static void _nas_signal_handler(int signal)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
static void _nas_clean(user_api_id_t *user_api_id, int usr_fd, int net_fd)
|
||||
static void _nas_clean(user_api_id_t *user_api_id, int net_fd)
|
||||
{
|
||||
LOG_FUNC_IN;
|
||||
|
||||
@@ -418,8 +418,8 @@ static void _nas_clean(user_api_id_t *user_api_id, int usr_fd, int net_fd)
|
||||
|
||||
LOG_TRACE (INFO, "UE-MAIN - "
|
||||
"Closing user connection %d and network connection %d",
|
||||
usr_fd, net_fd);
|
||||
user_api_close (user_api_id, usr_fd);
|
||||
user_api_get_fd (user_api_id), net_fd);
|
||||
user_api_close (user_api_id);
|
||||
network_api_close (net_fd);
|
||||
|
||||
LOG_FUNC_OUT
|
||||
|
||||
Reference in New Issue
Block a user