terminate_proc is shared between dbus and unix

This commit is contained in:
Nikos Mavrogiannopoulos
2015-04-03 14:49:58 +02:00
parent a85dfcc3d8
commit abfcee5991
2 changed files with 10 additions and 10 deletions

View File

@@ -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)

View File

@@ -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