From 1a85dd32316bf21114a144afcb379d0012b1264e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Wed, 28 Aug 2013 23:30:37 +0200 Subject: [PATCH] Remove comments that was moved to .h file, rename goto label.. --- src/supervisor.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/supervisor.c b/src/supervisor.c index c59bc91..1a89a39 100644 --- a/src/supervisor.c +++ b/src/supervisor.c @@ -44,7 +44,7 @@ static int watch(pid_t pid) int status; pid_t rc; -restart: +again: rc = waitpid(pid, &status, 0); if (rc == -1 && errno == EINTR) { if (restart_flag) { @@ -52,13 +52,13 @@ restart: kill_supervised_process(pid); /* next waitpid should notify us of the death and * we'll restart the process */ - goto restart; + goto again; } else if (exit_flag) { exit_flag = 0; return CLEAN_EXIT; } - goto restart; + goto again; } else if (rc == -1) { return BAD_EXIT; @@ -110,21 +110,7 @@ static void install_signal_handlers(void) sigaction(SIGINT, &act, &orig_int_sa); } -/** Supervises this process - restart if it dies. - * - * The program should call supervise() at a pristine state (all relevant file descriptors closed, etc). - * supervise() will return 0 if all is ok, and the program can continue.(returning != 0 means - * the supervisor couldn't start, and the calling process must exit) - * - * This will run the actual process as a child process. If that child process dies by any means, - * supervise will create another child process, where supervise() returns 0 again. - * - * To kill the supervisor process and the supervised process, send SIGERM/SIGHUP/SIGINT to the - * parent supervisor process. - * Sending SIGUSR1 to the parent supervisor process will terminate the current child process and - * restart it. - * - * The supervised child process must exit if it recieves a SIGTERM */ +//See notes in supervisor.h int uc_supervise(void) { pid_t pid;