X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/53a941d3f97a50964587c6e9533b1e43e74a57a8..a50f9a0eaed03dfe85ff3d7a4c24da20ac705dae:/client/tripectl.c diff --git a/client/tripectl.c b/client/tripectl.c index af5c1838..e171b0da 100644 --- a/client/tripectl.c +++ b/client/tripectl.c @@ -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"); } @@ -461,6 +450,7 @@ int main(int argc, char *argv[]) DA_UNSHIFT(&spawnopts, (char *)sock); DA_UNSHIFT(&spawnopts, "-a"); DA_UNSHIFT(&spawnopts, "-d."); + DA_UNSHIFT(&spawnopts, "-F"); DA_UNSHIFT(&spawnopts, (char *)spawnpath); DA_PUSH(&spawnopts, 0); if (socketpair(PF_UNIX, SOCK_STREAM, 0, pfd)) @@ -473,15 +463,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)); }