projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Configuration sample for postlicyd-rsyncrbl.
[apps/pfixtools.git]
/
common
/
server.c
diff --git
a/common/server.c
b/common/server.c
index
73c2888
..
78af625
100644
(file)
--- a/
common/server.c
+++ b/
common/server.c
@@
-135,11
+135,22
@@
static int start_client(server_t *server, start_client_t starter,
}
int server_loop(start_client_t starter, delete_client_t deleter,
}
int server_loop(start_client_t starter, delete_client_t deleter,
- run_client_t runner, void* config) {
+ run_client_t runner, refresh_t refresh, void* config) {
+ info("entering processing loop");
while (!sigint) {
struct epoll_event evts[1024];
int n;
while (!sigint) {
struct epoll_event evts[1024];
int n;
+ if (sighup && refresh) {
+ sighup = false;
+ info("refreshing...");
+ if (!refresh(config)) {
+ crit("error while refreshing configuration");
+ return EXIT_FAILURE;
+ }
+ info("refresh done, processing loop restarts");
+ }
+
n = epoll_select(evts, countof(evts), -1);
if (n < 0) {
if (errno != EAGAIN && errno != EINTR) {
n = epoll_select(evts, countof(evts), -1);
if (n < 0) {
if (errno != EAGAIN && errno != EINTR) {
@@
-175,5
+186,6
@@
int server_loop(start_client_t starter, delete_client_t deleter,
}
}
}
}
}
}
+ info("exit requested");
return EXIT_SUCCESS;
}
return EXIT_SUCCESS;
}