]> andersk Git - moira.git/blobdiff - gen/aliases.qc
fixed name section
[moira.git] / gen / aliases.qc
index d5e9f91aeebe5c32506b82fafe137f76274c42a0..e37758863fa862a23419b3d5332a561c3fc3fa16 100644 (file)
@@ -5,9 +5,14 @@
  *     user pobox entries
  *     maillist expansions
  *     sublists of maillists
+ *
+ *  (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 <string.h>
 #include <sms.h>
@@ -22,6 +27,7 @@
 
 char *divide = "########################################################################";
 extern int errno;
+char *whoami = "aliases.gen";
 char *ingres_date_and_time();
 
 
@@ -35,7 +41,9 @@ char **argv;
     struct stat sb;
 ##  int flag1, flag2, flag3;
 ##  char *filetime;
+    int ingerr();
 
+    IIseterr(ingerr);
 ##  ingres sms
 
     if (argc == 2) {
@@ -90,6 +98,32 @@ char **argv;
 }
 
 
+/*
+ * ingerr: (supposedly) called when Ingres indicates an error.
+ * I have not yet been able to get this to work to intercept a
+ * database open error.
+ */
+#define INGRES_DEADLOCK 4700
+
+static int ingerr(num)
+    int *num;
+{
+    char buf[256];
+    int ingres_errno;
+
+    switch (*num) {
+    case INGRES_DEADLOCK:
+       ingres_errno = SMS_DEADLOCK;
+       break;
+    default:
+       ingres_errno = SMS_INGRES_ERR;
+    }
+    com_err(whoami, SMS_INGRES_ERR, " code %d\n", *num);
+    critical_alert("DCM", "Alias build encountered INGRES ERROR %d", *num);
+    exit(ingres_errno);
+}
+
+
 struct hash *users, *machines, *strings, *lists;
 struct user {
     char login[9];
This page took 0.124075 seconds and 4 git commands to generate.