mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 08:46:58 +08:00
terminate_proc is shared between dbus and unix
This commit is contained in:
@@ -623,16 +623,6 @@ static void method_unban_ip(method_ctx *ctx,
|
||||
return;
|
||||
}
|
||||
|
||||
static void terminate_proc(main_server_st *s, proc_st *proc)
|
||||
{
|
||||
/* if it has an IP, send a signal so that we cleanup
|
||||
* and get stats properly */
|
||||
if (proc->pid != -1 && proc->pid != 0)
|
||||
kill(proc->pid, SIGTERM);
|
||||
else
|
||||
remove_proc(s, proc, 1);
|
||||
}
|
||||
|
||||
static void method_disconnect_user_name(method_ctx *ctx,
|
||||
int cfd, uint8_t * msg,
|
||||
unsigned msg_size)
|
||||
|
||||
@@ -9,4 +9,14 @@ void ctl_handler_deinit(main_server_st* s);
|
||||
int ctl_handler_set_fds(main_server_st* s, fd_set *rd_set, fd_set *wr_set);
|
||||
void ctl_handler_run_pending(main_server_st* s, fd_set *rd_set, fd_set *wr_set);
|
||||
|
||||
inline static void terminate_proc(main_server_st *s, proc_st *proc)
|
||||
{
|
||||
/* if it has an IP, send a signal so that we cleanup
|
||||
* and get stats properly */
|
||||
if (proc->pid != -1 && proc->pid != 0)
|
||||
kill(proc->pid, SIGTERM);
|
||||
else
|
||||
remove_proc(s, proc, 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user