]> andersk Git - moira.git/blobdiff - gen/util.c
Code style cleanup. (No functional changes)
[moira.git] / gen / util.c
index 5c70fffa00d6fd376ce076163e46563477f13d2f..2640b2ca58bbcbd06c55aeb3512c38803021c35e 100644 (file)
 
 extern void sqlglm(char buf[], int *, int *);
 
-fix_file(targetfile)
-char *targetfile;
+fix_file(char *targetfile)
 {
-    char oldfile[64], filename[64];
+  char oldfile[64], filename[64];
 
-    sprintf(oldfile, "%s.old", targetfile);
-    sprintf(filename, "%s~", targetfile);
-    if (rename(targetfile, oldfile) == 0) {
-       if (rename(filename, targetfile) < 0) {
-           rename(oldfile, targetfile);
-           perror("Unable to install new file (rename failed)\n");
-           fprintf(stderr, "Filename = %s\n", targetfile);
-           exit(MR_CCONFIG);
+  sprintf(oldfile, "%s.old", targetfile);
+  sprintf(filename, "%s~", targetfile);
+  if (rename(targetfile, oldfile) == 0)
+    {
+      if (rename(filename, targetfile) < 0)
+       {
+         rename(oldfile, targetfile);
+         perror("Unable to install new file (rename failed)\n");
+         fprintf(stderr, "Filename = %s\n", targetfile);
+         exit(MR_CCONFIG);
        }
-    } else {
-       if (rename(filename, targetfile) < 0) {
-           perror("Unable to rename old file\n");
-           fprintf(stderr, "Filename = %s\n", targetfile);
-           exit(MR_CCONFIG);
+    }
+  else
+    {
+      if (rename(filename, targetfile) < 0)
+       {
+         perror("Unable to rename old file\n");
+         fprintf(stderr, "Filename = %s\n", targetfile);
+         exit(MR_CCONFIG);
        }
     }
-    unlink(oldfile);
+  unlink(oldfile);
 }
 
 
-char *dequote(s)
-register char *s;
+char *dequote(register char *s)
 {
-    char *last = s;
+  char *last = s;
 
-    while (*s) {
-       if (*s == '"')
-         *s = '\'';
-       else if (*s != ' ')
-         last = s;
-       s++;
+  while (*s)
+    {
+      if (*s == '"')
+       *s = '\'';
+      else if (*s != ' ')
+       last = s;
+      s++;
     }
-    if (*last == ' ')
-      *last = '\0';
-    else
-      *(++last) = '\0';
-    return(s);
+  if (*last == ' ')
+    *last = '\0';
+  else
+    *(++last) = '\0';
+  return s;
 }
 
 
-
-db_error(code)
-int code;
+db_error(int code)
 {
-    extern char *whoami;
-    char buf[256];
-    int bufsize=256, len=0;
+  extern char *whoami;
+  char buf[256];
+  int bufsize = 256, len = 0;
 
-    if (code == -1013) {
-       com_err(whoami, 0, "build cancelled by user");
-       exit(MR_ABORT);
+  if (code == -1013)
+    {
+      com_err(whoami, 0, "build cancelled by user");
+      exit(MR_ABORT);
     }
 
-    com_err(whoami, MR_DBMS_ERR, " code %d\n", code);
-    sqlglm(buf, &bufsize, &len);
-    buf[len]=0;
-    com_err(whoami, 0, "SQL error text = %s", buf);
-    critical_alert("DCM", "%s build encountered DATABASE ERROR %d\n%s",
-                  whoami, code, buf);
-    exit(MR_DBMS_ERR);
+  com_err(whoami, MR_DBMS_ERR, " code %d\n", code);
+  sqlglm(buf, &bufsize, &len);
+  buf[len] = 0;
+  com_err(whoami, 0, "SQL error text = %s", buf);
+  critical_alert("DCM", "%s build encountered DATABASE ERROR %d\n%s",
+                whoami, code, buf);
+  exit(MR_DBMS_ERR);
 }
This page took 0.049446 seconds and 4 git commands to generate.