projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement lightweight getaddrinfo_a wrappers.
[apps/pfixtools.git]
/
postlicyd.c
diff --git
a/postlicyd.c
b/postlicyd.c
index
7877665
..
c20973e
100644
(file)
--- a/
postlicyd.c
+++ b/
postlicyd.c
@@
-39,30
+39,38
@@
#include <syslog.h>
#include "job.h"
#include <syslog.h>
#include "job.h"
+#include "gai.h"
bool cleanexit = false;
bool cleanexit = false;
-static void shutdown(void)
+static void main_initialize(void)
+{
+ openlog("postlicyd", LOG_PID, LOG_MAIL);
+ gai_initialize();
+ job_initialize();
+ syslog(LOG_INFO, "Starting...");
+}
+
+static void main_shutdown(void)
{
syslog(LOG_INFO, cleanexit ? "Stopping..." : "Unclean exit...");
job_shutdown();
{
syslog(LOG_INFO, cleanexit ? "Stopping..." : "Unclean exit...");
job_shutdown();
+ gai_shutdown();
closelog();
}
int main(void)
{
closelog();
}
int main(void)
{
- if (atexit(shutdown)) {
+ if (atexit(
main_
shutdown)) {
fputs("Cannot hook my atexit function, quitting !\n", stderr);
return EX_CONFIG;
}
fputs("Cannot hook my atexit function, quitting !\n", stderr);
return EX_CONFIG;
}
- openlog("postlicyd", LOG_PID, LOG_MAIL);
- job_initialize();
- syslog(LOG_INFO, "Starting...");
+ main_initialize();
job_loop();
cleanexit = true;
job_loop();
cleanexit = true;
- shutdown();
+
main_
shutdown();
return 0;
}
return 0;
}