chiark / gitweb /
Various minor cleanups.
[tripe] / client / tripectl.c
index af5c1838ee7a49909cd26d82cb9cf7cf33dbfac6..d9f5dd8161192886162307ad27b3f4785960c6d5 100644 (file)
@@ -120,10 +120,7 @@ static void checkbg(char **p)
 }
 
 static void checkfg(void)
-{
-  if (bgtag)
-    die(EXIT_FAILURE, "unexpected foreground response");
-}
+  { if (bgtag) die(EXIT_FAILURE, "unexpected foreground response"); }
 
 static void cline(char *p, size_t len, void *b)
 {
@@ -273,18 +270,10 @@ static void logfile(const char *name)
 
 static void sighup(int sig, void *v) { logfile(logname); }
 
-static void cleanup(void)
-{
-  if (pidfile)
-    unlink(pidfile);
-}
+static void cleanup(void) { if (pidfile) unlink(pidfile); }
 
 static void sigdie(int sig)
-{
-  cleanup();
-  signal(sig, SIG_DFL);
-  raise(sig);
-}
+  { cleanup(); signal(sig, SIG_DFL); raise(sig); }
 
 static void version(FILE *fp)
   { pquis(fp, "$, TrIPE version " VERSION "\n"); }
@@ -473,15 +462,12 @@ int main(int argc, char *argv[])
     if (!kid) {
       dup2(pfd[1], STDIN_FILENO);
       dup2(pfd[1], STDOUT_FILENO);
-      close(pfd[1]);
       close(pfd[0]);
-      if (logfp)
-       fclose(logfp);
-      if (pidfp)
-       fclose(pidfp);
+      close(pfd[1]);
+      if (logfp) fclose(logfp);
+      if (pidfp) fclose(pidfp);
       closelog();
-      if (f & f_daemon)
-       detachtty();
+      if (f & f_daemon) detachtty();
       execvp(DA(&spawnopts)[0], DA(&spawnopts));
       die(127, "couldn't exec `%s': %s", spawnpath, strerror(errno));
     }