Remove comments that was moved to .h file, rename goto label..
This commit is contained in:
+4
-18
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user