mirror of
https://github.com/troglobit/finit.git
synced 2026-10-13 10:14:47 +00:00
Follow-up to ec2900e: minor cleanup + signed vs unsigned comparison
Minor coding style cleanup. Also, clang complained of a signed vs unsigned comparison in service_retry(), max(timeout, svc->restart_tmo) Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+3
-4
@@ -1204,13 +1204,12 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
|
||||
else if (!strncasecmp(cmd, "restart:", 8))
|
||||
restart_max = atoi(&cmd[8]);
|
||||
else if (!strncasecmp(cmd, "restarttmo:", 11))
|
||||
restart_tmo = atoi(&cmd[11])*1000;
|
||||
restart_tmo = atoi(&cmd[11]) * 1000;
|
||||
else if (!strncasecmp(cmd, "norestart", 9))
|
||||
restart_max = 0;
|
||||
else if (!strncasecmp(cmd, "oncrash:", 8)) {
|
||||
if (!strncasecmp(&cmd[8], "reboot", 6)) {
|
||||
if (!strncasecmp(&cmd[8], "reboot", 6))
|
||||
oncrash_action = SVC_ONCRASH_REBOOT;
|
||||
}
|
||||
}
|
||||
else if (!strncasecmp(cmd, "respawn", 7))
|
||||
respawn = 1;
|
||||
@@ -1610,8 +1609,8 @@ static void service_post_script(svc_t *svc)
|
||||
|
||||
static void service_retry(svc_t *svc)
|
||||
{
|
||||
int timeout;
|
||||
char *restart_cnt = (char *)&svc->restart_cnt;
|
||||
int timeout;
|
||||
|
||||
service_timeout_cancel(svc);
|
||||
if (svc->respawn) {
|
||||
|
||||
@@ -138,8 +138,8 @@ typedef struct svc {
|
||||
/* Counters */
|
||||
char once; /* run/task, (at least) once per runlevel */
|
||||
unsigned char restart_max; /* Maximum number of restarts allowed */
|
||||
unsigned restart_tmo; /* Time required for the service to start. */
|
||||
unsigned oncrash_action; /* Action to perform in crashed state. */
|
||||
int restart_tmo; /* Time required for the service to start. */
|
||||
unsigned char oncrash_action; /* Action to perform in crashed state. */
|
||||
char respawn; /* ttys, or services with `respawn`, never increment restart_cnt */
|
||||
const char restart_cnt; /* Incremented for each restart by service monitor. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user