]> andersk Git - moira.git/blobdiff - lib/critical.c
renamed sms_do_update.c to sms_ops.c
[moira.git] / lib / critical.c
index 51680ba6a9b46ef4335cbef3f0ff4569ee3689f0..b4f63c2776dc7891267fe03ec0180a60e0467c6a 100644 (file)
@@ -1,8 +1,13 @@
 /* $Header$
  *
  * Log and send a zephyrgram about any critical errors.
+ *
+ *  (c) Copyright 1988 by the Massachusetts Institute of Technology.
+ *  For copying and distribution information, please see the file
+ *  <mit-copyright.h>.
  */
 
+#include <mit-copyright.h>
 #include <stdio.h>
 #include <sys/file.h>
 #include <zephyr/zephyr.h>
@@ -14,6 +19,8 @@
 /* mode to create the file with */
 #define LOGFILEMODE    0644
 
+extern char *whoami;
+
 
 void critical_alert(instance, msg, args)
   char *instance;              /* Instance for zephyr gram */
@@ -21,7 +28,8 @@ void critical_alert(instance, msg, args)
                                /* args = arguements, printf style */
   /* This routine sends a class SMS zephyrgram of specified instance
      and logs to a special logfile the message passed to it via msg
-     and args in printf format. */
+     and args in printf format.  *** It expects the global variable
+     whoami to be defined and contain the name of the calling program. */
   /* Note: The part of this code that process the variable arguements
      was stolen from sprintf(). */
 {
@@ -52,6 +60,8 @@ void critical_alert(instance, msg, args)
        fprintf(crit, "%s <%d> %s\n", time_s, getpid(), buf);
        fclose(crit);
     }
+
+    com_err(whoami, 0, buf);
 }
 
 
This page took 0.031996 seconds and 4 git commands to generate.