blob: 97137e873bb61df7a42cdddb3e2c5bb2c0c28580 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#include <signal.h>
#include <string.h>
#include <stdio.h>
#include "server.h"
static volatile char ZoO_SERVER_IS_RUNNING = (char) 1;
static void request_termination (int const signo)
{
if ((signo == SIGINT) || (signo == SIGTERM))
{
ZoO_server_request_termination();
}
}
void ZoO_server_request_termination (void)
{
ZoO_SERVER_IS_RUNNING = (char) 0;
}
int ZoO_server_is_running (void)
{
return (int) ZoO_SERVER_IS_RUNNING;
}
int ZoO_server_set_signal_handlers (void)
{
struct sigaction act;
/*
act.sa_handler = request_termination;
act.sa_mask =
act.sa_flags =
act.sa_restorer =
*/
/* TODO */
return -1;
}
|