From cbc1e00dbd0e45d064bce91b84e0959937894daf Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sat, 1 Dec 2007 13:30:16 +0100 Subject: [PATCH] prepare hooking of policy.c module. Signed-off-by: Pierre Habouzit --- Makefile | 4 ++-- main-postlicyd.c | 10 ++-------- postfix.c => policy.c | 8 +++++++- postfix.h => policy.h | 7 +++++-- 4 files changed, 16 insertions(+), 13 deletions(-) rename postfix.c => policy.c (98%) rename postfix.h => policy.h (97%) diff --git a/Makefile b/Makefile index 3dcb94c..29ee7aa 100644 --- a/Makefile +++ b/Makefile @@ -45,8 +45,8 @@ TESTS = tst-rbl GENERATED = tokens.h tokens.c postlicyd_SOURCES = common.c threads.c str.c buffer.c \ - greylist.c rbl.c \ - $(GENERATED) postfix.c main-postlicyd.c + policy.c greylist.c rbl.c \ + $(GENERATED) main-postlicyd.c postlicyd_LIBADD = -lpthread $(TC_LIBS) postlicyd_CFLAGS = $(TC_CFLAGS) diff --git a/main-postlicyd.c b/main-postlicyd.c index ecf60f0..92c2026 100644 --- a/main-postlicyd.c +++ b/main-postlicyd.c @@ -35,8 +35,8 @@ #include -#include "epoll.h" #include "threads.h" +#include "policy.h" #define DAEMON_NAME "postlicyd" @@ -72,12 +72,6 @@ void usage(void) /* }}} */ -void *job_run(int fd, void *data) -{ - close(fd); - return NULL; -} - static int main_loop(void) { int exitcode = EXIT_SUCCESS; @@ -91,7 +85,7 @@ static int main_loop(void) continue; } - thread_launch(job_run, fd, NULL); + thread_launch(policy_run, fd, NULL); threads_join(); } diff --git a/postfix.c b/policy.c similarity index 98% rename from postfix.c rename to policy.c index 0b5f84a..30bc588 100644 --- a/postfix.c +++ b/policy.c @@ -34,7 +34,7 @@ */ #include "common.h" -#include "postfix.h" +#include "policy.h" #include "buffer.h" #include "tokens.h" @@ -231,3 +231,9 @@ static void postfix_process(job_t *job) } } #endif + +void *policy_run(int fd, void *data) +{ + close(fd); + return NULL; +} diff --git a/postfix.h b/policy.h similarity index 97% rename from postfix.h rename to policy.h index 88e4f8d..077b045 100644 --- a/postfix.h +++ b/policy.h @@ -33,8 +33,8 @@ * Copyright © 2006-2007 Pierre Habouzit */ -#ifndef PFIXTOOLS_POSTFIX_H -#define PFIXTOOLS_POSTFIX_H +#ifndef PFIXTOOLS_POLICY_H +#define PFIXTOOLS_POLICY_H #include @@ -102,4 +102,7 @@ static inline void query_wipe(query_t *rq) { DO_NEW(query_t, query); DO_DELETE(query_t, query); + +void *policy_run(int fd, void *); + #endif -- 2.20.1