prepare hooking of policy.c module.
authorPierre Habouzit <madcoder@debian.org>
Sat, 1 Dec 2007 12:30:16 +0000 (13:30 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sat, 1 Dec 2007 12:30:16 +0000 (13:30 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Makefile
main-postlicyd.c
policy.c [moved from postfix.c with 98% similarity]
policy.h [moved from postfix.h with 97% similarity]

index 3dcb94c..29ee7aa 100644 (file)
--- 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)
 
index ecf60f0..92c2026 100644 (file)
@@ -35,8 +35,8 @@
 
 #include <getopt.h>
 
-#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();
     }
 
similarity index 98%
rename from postfix.c
rename to policy.c
index 0b5f84a..30bc588 100644 (file)
--- 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;
+}
similarity index 97%
rename from postfix.h
rename to policy.h
index 88e4f8d..077b045 100644 (file)
--- 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 <stddef.h>
 
@@ -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