src/rc/supervise-daemon.c: formatting fixes

Fix misleading indentation and other erroneous whitespace.
This fixes #273.
This commit is contained in:
philhofer 2018-12-23 12:10:56 -08:00 committed by William Hubbs
parent d328de198d
commit 97e74f9734

View File

@ -237,7 +237,7 @@ static char * expand_home(const char *home, const char *path)
ppath++; ppath++;
if (!home) { if (!home) {
free(opath); free(opath);
return xstrdup(path); return xstrdup(path);
} }
if (!ppath) { if (!ppath) {
@ -535,7 +535,7 @@ static void supervisor(char *exec, char **argv)
sigaction(SIGTERM, &sa, NULL); sigaction(SIGTERM, &sa, NULL);
fp = fopen(pidfile, "w"); fp = fopen(pidfile, "w");
if (! fp) if (!fp)
eerrorx("%s: fopen `%s': %s", applet, pidfile, strerror(errno)); eerrorx("%s: fopen `%s': %s", applet, pidfile, strerror(errno));
fprintf(fp, "%d\n", getpid()); fprintf(fp, "%d\n", getpid());
fclose(fp); fclose(fp);
@ -557,10 +557,10 @@ static void supervisor(char *exec, char **argv)
alarm(healthcheckdelay); alarm(healthcheckdelay);
else if (healthchecktimer) else if (healthchecktimer)
alarm(healthchecktimer); alarm(healthchecktimer);
failing = 0; failing = 0;
while (!exiting) { while (!exiting) {
healthcheck_respawn = 0; healthcheck_respawn = 0;
fifo_fd = open(fifopath, O_RDONLY); fifo_fd = open(fifopath, O_RDONLY);
if (fifo_fd > 0) { if (fifo_fd > 0) {
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
count = read(fifo_fd, buf, sizeof(buf) - 1); count = read(fifo_fd, buf, sizeof(buf) - 1);
@ -604,7 +604,7 @@ static void supervisor(char *exec, char **argv)
healthcheck_respawn = 1; healthcheck_respawn = 1;
} }
} }
if (exiting ) { if (exiting) {
alarm(0); alarm(0);
syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid); syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid);
nkilled = run_stop_schedule(applet, NULL, NULL, child_pid, 0, nkilled = run_stop_schedule(applet, NULL, NULL, child_pid, 0,
@ -1062,8 +1062,8 @@ int main(int argc, char **argv)
c++; c++;
} }
xasprintf(&varbuf, "%d", x); xasprintf(&varbuf, "%d", x);
rc_service_value_set(svcname, "argc", varbuf); rc_service_value_set(svcname, "argc", varbuf);
free(varbuf); free(varbuf);
rc_service_value_set(svcname, "exec", exec); rc_service_value_set(svcname, "exec", exec);
supervisor(exec, argv); supervisor(exec, argv);
} else } else