-diewrap(sysdie, " critical", LOG_CRIT, errno, 16);
-diewrap(die, " critical", LOG_CRIT, -1, 16);
+#define INNLOGWRAP_DECLARE(fn, pfx, sysloglevel) \
+ static void duct_log_##fn(int errval, const char *fmt, va_list al, int l) { \
+ logv(sysloglevel, pfx, errnoval ? errnoval : -1, fmt, al); \
+ }
+#define INNLOGWRAP_CALL(fn, pfx, sysloglevel) \
+ fn##_set_handlers(1, duct_log_##fn);
+
+
+static int innduct_fatal_cleanup(void) { return 12; } /* used for libinn die */
+
+/* We want to extend the set of logging functions from inn, and we
+ * want to prepend the site name to all our messages. */
+
+diewrap(syscrash, " critical", LOG_CRIT, errno, 16);
+diewrap(crash, " critical", LOG_CRIT, -1, 16);