diff --git a/plugins/pidfile.c b/plugins/pidfile.c index a3320643..2421a3b9 100644 --- a/plugins/pidfile.c +++ b/plugins/pidfile.c @@ -48,7 +48,7 @@ static void pidfile_callback(void *UNUSED(arg), int fd, int UNUSED(events)) sz = read(fd, ev_buf, sizeof(ev_buf) - 1); if (sz <= 0) { - _pe("invalid inotify event\n"); + _pe("invalid inotify event"); return; } ev_buf[sz] = 0; diff --git a/service.c b/service.c index 4cb2e557..b92d0cc0 100644 --- a/service.c +++ b/service.c @@ -793,7 +793,7 @@ restart: enabled = service_enabled(svc); _d("%20s(%4d): %8s %3sabled/%-7s cond:%-4s", svc->cmd, svc->pid, - svc_status(svc), enabled? "en" : "dis", svc_dirtystr(svc), + svc_status(svc), enabled ? "en" : "dis", svc_dirtystr(svc), condstr(cond_get_agg(svc->cond))); switch(svc->state) { diff --git a/svc.c b/svc.c index 6c6d2973..7979d01b 100644 --- a/svc.c +++ b/svc.c @@ -429,8 +429,10 @@ char *svc_status(svc_t *svc) case SVC_BLOCK_INETD_BUSY: return "busy"; } + case SVC_DONE_STATE: return "done"; + case SVC_STOPPING_STATE: switch (svc->type) { case SVC_TYPE_INETD_CONN: @@ -440,10 +442,13 @@ char *svc_status(svc_t *svc) default: return "stopping"; } + case SVC_WAITING_STATE: return "waiting"; + case SVC_READY_STATE: return "ready"; + case SVC_RUNNING_STATE: return "running"; @@ -460,8 +465,8 @@ const char *svc_dirtystr(svc_t *svc) return "updated"; else if (svc_is_changed(svc)) return "UNKNOWN"; - else - return "clean"; + + return "clean"; } /* Same base service, return unique ID */ diff --git a/svc.h b/svc.h index abc30113..ed0fa9a1 100644 --- a/svc.h +++ b/svc.h @@ -169,9 +169,9 @@ int svc_is_unique (svc_t *svc); static inline int svc_in_runlevel(svc_t *svc, int runlevel) { return svc && ISSET(svc->runlevels, runlevel); } static inline int svc_has_sighup(svc_t *svc) { return svc && 0 != svc->sighup; } -static inline void svc_starting (svc_t *svc) { svc->starting = 1; } -static inline void svc_started (svc_t *svc) { svc->starting = 0; } -static inline int svc_is_starting(svc_t *svc) { 0 != svc->starting; } +static inline void svc_starting (svc_t *svc) { svc->starting = 1; } +static inline void svc_started (svc_t *svc) { svc->starting = 0; } +static inline int svc_is_starting(svc_t *svc) { return 0 != svc->starting; } static inline int svc_is_dynamic(svc_t *svc) { return svc && 0 != svc->mtime; } static inline int svc_is_removed(svc_t *svc) { return svc && -1 == svc->dirty; }