mirror of
https://github.com/troglobit/finit.git
synced 2026-10-16 10:39:35 +00:00
New helper function, resolves svc_t type to string
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
8e2d006048
commit
222d8d3575
1 file changed
+25
@@ -278,6 +278,31 @@ static inline int svc_has_cond(svc_t *svc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline const char *svc_typestr(svc_t *svc)
|
||||
{
|
||||
switch (svc->type) {
|
||||
case SVC_TYPE_FREE:
|
||||
return "free";
|
||||
|
||||
case SVC_TYPE_SERVICE:
|
||||
return "service";
|
||||
|
||||
case SVC_TYPE_TASK:
|
||||
return "task";
|
||||
|
||||
case SVC_TYPE_RUN:
|
||||
return "run";
|
||||
|
||||
case SVC_TYPE_TTY:
|
||||
return "tty";
|
||||
|
||||
case SVC_TYPE_SYSV:
|
||||
return "sysv";
|
||||
}
|
||||
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
static inline char *svc_status(svc_t *svc)
|
||||
{
|
||||
if (!svc)
|
||||
|
||||
Reference in new issue
Block a user