about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--daemon.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/daemon.c b/daemon.c
index cf7f805..59215f6 100644
--- a/daemon.c
+++ b/daemon.c
@@ -321,6 +321,31 @@ int main(int argc, char *argv[]) {
 	sigset_t mask;
 	sigemptyset(&mask);
 	for (;;) {
+		if (signals[SIGCHLD]) {
+			int status;
+			pid_t pid;
+			while (0 < (pid = waitpid(-1, &status, WNOHANG))) {
+				serviceReap(pid, status);
+			}
+			if (pid < 0 && errno != ECHILD) syslog(LOG_WARNING, "waitpid: %m");
+			setTitle();
+			signals[SIGCHLD] = 0;
+		}
+
+		if (signals[SIGINT] || signals[SIGTERM]) {
+			break;
+		}
+		if (signals[SIGHUP]) {
+			parseConfig(configPath);
+			setTitle();
+			signals[SIGHUP] = 0;
+		}
+		if (signals[SIGINFO]) {
+			char command[] = "status *";
+			parseControl(command);
+			signals[SIGINFO] = 0;
+		}
+
 		struct pollfd fds[1 + 2 * services.len];
 		fds[0].fd = fifo;
 		fds[0].events = POLLIN;
@@ -393,31 +418,6 @@ int main(int argc, char *argv[]) {
 			}
 			setTitle();
 		}
-
-		if (signals[SIGCHLD]) {
-			int status;
-			pid_t pid;
-			while (0 < (pid = waitpid(-1, &status, WNOHANG))) {
-				serviceReap(pid, status);
-			}
-			if (pid < 0 && errno != ECHILD) syslog(LOG_WARNING, "waitpid: %m");
-			setTitle();
-			signals[SIGCHLD] = 0;
-		}
-
-		if (signals[SIGINT] || signals[SIGTERM]) {
-			break;
-		}
-		if (signals[SIGHUP]) {
-			parseConfig(configPath);
-			setTitle();
-			signals[SIGHUP] = 0;
-		}
-		if (signals[SIGINFO]) {
-			char command[] = "status *";
-			parseControl(command);
-			signals[SIGINFO] = 0;
-		}
 	}
 
 	close(fifo);
s/commit/torus.h?id=a97f4ebf9f2b976e78282928704d6d39768b8362&follow=1'>Add tile create and access timestampsJune McEnroe 2017-07-30Assert stable struct Tile field offsetsJune McEnroe 2017-07-30Add chroot.shJune McEnroe 2017-07-30Add ` commandJune McEnroe 2017-07-30Add sshd_configJune McEnroe 2017-07-30Add termcap patchJune McEnroe