87 static void bounce_cleanup_callback(
void)
93 if (bounce_cleanup_path)
99 if (bounce_cleanup_func)
100 bounce_cleanup_func();
107 const char *myname =
"bounce_cleanup_log";
112 if (bounce_cleanup_path == 0)
113 msg_panic(
"%s: no cleanup context", myname);
124 static void bounce_cleanup_sig(
int sig)
130 if (bounce_cleanup_path)
139 const char *myname =
"bounce_cleanup_register";
144 if (bounce_cleanup_path)
153 bounce_cleanup_func =
msg_cleanup(bounce_cleanup_callback);
154 signal(SIGTERM, bounce_cleanup_sig);
161 const char *myname =
"bounce_cleanup_unregister";
166 if (bounce_cleanup_path == 0)
167 msg_panic(
"%s: no cleanup context", myname);
173 signal(SIGTERM, SIG_DFL);
176 bounce_cleanup_path = 0;
NORETURN msg_panic(const char *fmt,...)
void(* MSG_CLEANUP_FN)(void)
void bounce_cleanup_register(char *service, char *queue_id)
const char * mail_queue_path(VSTRING *buf, const char *queue_name, const char *queue_id)
VSTRING * vstring_alloc(ssize_t len)
void bounce_cleanup_log(void)
void bounce_cleanup_unregister(void)
VSTRING * vstring_free(VSTRING *vp)
VSTRING * bounce_cleanup_path
MSG_CLEANUP_FN msg_cleanup(MSG_CLEANUP_FN cleanup_fn)