]> andersk Git - moira.git/blobdiff - server/increment.pc
Allow hostname to start with a digit in hostname_check, but disallow it
[moira.git] / server / increment.pc
index 12ad9c37ba316f90247119788e7697aab3a1ce44..30a559e78c31962f0c865cc0cad4923a6f170a4d 100644 (file)
@@ -56,6 +56,7 @@ struct iupdate {
 };
 
 void next_incremental(void);
+char **copy_argv(char **argv, int argc);
 void free_argv(char **argv, int argc);
 int table_num(char *table);
 
@@ -313,9 +314,9 @@ void incremental_after(enum tables table, char *qual, char **argv)
   iu = xmalloc(sizeof(struct iupdate));
   iu->table = table_name[table];
   iu->beforec = beforec;
-  iu->before = mr_copy_args(before, beforec);
+  iu->before = copy_argv(before, beforec);
   iu->afterc = afterc;
-  iu->after = mr_copy_args(after, afterc);
+  iu->after = copy_argv(after, afterc);
   sq_save_data(incremental_sq, iu);
 }
 
@@ -390,7 +391,11 @@ void incremental_update(void)
     next_incremental();
 }
 
+/* Pro*C 2.2.4 can't cope with the sigset_t below, at least in Solaris 2.6.
+   We add DEFINE=_PROC_ to the proc invocation and then #ifndef that around
+   this function so proc will pass it through without reading it. */
 
+#ifndef _PROC_
 void next_incremental(void)
 {
   struct iupdate *iu;
@@ -445,7 +450,7 @@ void next_incremental(void)
   free_argv(iu->after, iu->afterc);
   free(iu);
 }
-
+#endif
 
 /* Called when the current transaction is aborted to throw away any queued
  * incremental updates
@@ -466,6 +471,14 @@ void incremental_flush(void)
 }
 
 
+char **copy_argv(char **argv, int argc)
+{
+  char **ret = xmalloc(sizeof(char *) * argc);
+  while (--argc >= 0)
+    ret[argc] = xstrdup(strtrim(argv[argc]));
+  return ret;
+}
+
 void free_argv(char **argv, int argc)
 {
   while (--argc >= 0)
This page took 0.034295 seconds and 4 git commands to generate.