mirror of
https://github.com/troglobit/finit.git
synced 2026-10-24 11:54:36 +00:00
Added implementation for the new command INIT_CMD_SIGNAL.
The implementation looks up the named service by using `svc_parse_jobstr`. The callbacks for `svc_parse_jobstr` has been augmented to accept a user data parameter. For this use case, a carrier for the actual signal was needed. The address of the signal parameter is taken and passed on as a `void *`. The callback then simply deferences it as an int - the signal number.
This commit is contained in:
1 parent
62da379472
commit
4121113688
4 files changed
+50
-20
No files matched your search
@@ -222,7 +222,7 @@ void svc_prune_bootstrap (void);
|
||||
void svc_enable (svc_t *svc);
|
||||
int svc_enabled (svc_t *svc);
|
||||
|
||||
int svc_parse_jobstr (char *str, size_t len, int (*found)(svc_t *), int (not_found)(char *, char *));
|
||||
int svc_parse_jobstr (char *str, size_t len, void *user_data, int (*found)(svc_t *, void *), int (not_found)(char *, char *, void *));
|
||||
|
||||
static inline int svc_is_daemon (svc_t *svc) { return svc && SVC_TYPE_SERVICE == svc->type; }
|
||||
static inline int svc_is_sysv (svc_t *svc) { return svc && SVC_TYPE_SYSV == svc->type; }
|
||||
|
||||
Reference in new issue
Block a user