]> andersk Git - moira.git/blobdiff - lib/critical.c
Switch from Imake-based build system to autoconf-based.
[moira.git] / lib / critical.c
index 6b96880f8ce2a5b1d98c88582d20e390cc9d5f89..c6971ded2266328c5a95e5517748eb4e92a47b2a 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 
-#ifdef ZEPHYR
+#ifdef HAVE_ZEPHYR
 /* need to include before moira.h, which includes krb_et.h, because
    zephyr.h is broken */
 #include <zephyr/zephyr.h>
@@ -21,10 +21,12 @@ extern Code_t ZSendNotice(ZNotice_t *notice, Z_AuthProc cert_routine);
 #include <moira_site.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#ifdef SYSLOG
+#ifndef HAVE_ZEPHYR
 #include <syslog.h>
 #endif
+#include <time.h>
 
 RCSID("$Header$");
 
@@ -93,11 +95,7 @@ void critical_alert(char *instance, char *msg, ...)
 
 void send_zgram(char *inst, char *msg)
 {
-#ifdef SYSLOG
-  char *buf;
-#endif
-
-#ifdef ZEPHYR
+#ifdef HAVE_ZEPHYR
   ZNotice_t znotice;
 
   memset(&znotice, 0, sizeof(znotice));
@@ -111,9 +109,10 @@ void send_zgram(char *inst, char *msg)
   znotice.z_opcode = "";
   znotice.z_recipient = "";
   ZSendNotice(&znotice, ZNOAUTH);
-#endif
-#ifdef SYSLOG
-  buf = malloc(9 + strlen(instance) + strlen(msg));
+#else
+  char *buf;
+
+  buf = malloc(9 + strlen(inst) + strlen(msg));
   if (buf)
     {
       sprintf(buf, "MOIRA: %s %s", inst, msg);
This page took 0.035381 seconds and 4 git commands to generate.