mirror of
https://github.com/troglobit/finit.git
synced 2026-10-14 10:19:36 +00:00
API refactor, allow svc_stop_completed() to return the pending svc
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
586f0a7799
commit
8a1015cf3e
2 files changed
+7
-8
No files matched your search
@@ -307,20 +307,19 @@ void svc_foreach_type(int types, void (*cb)(svc_t *))
|
||||
* svc_stop_completed - Have all stopped services been collected?
|
||||
*
|
||||
* Returns:
|
||||
* 1, if all stopped services have been collected. 0 otherwise.
|
||||
* %NULL if all stopped services have been collected, otherwise a
|
||||
* pointer to the first svc_t waiting to be collected.
|
||||
*/
|
||||
int svc_stop_completed(void)
|
||||
svc_t *svc_stop_completed(void)
|
||||
{
|
||||
svc_t *svc;
|
||||
|
||||
for (svc = svc_iterator(1); svc; svc = svc_iterator(0)) {
|
||||
if (svc->state == SVC_STOPPING_STATE) {
|
||||
_e("Waiting to collect %s(%d) ...", svc->cmd, svc->pid);
|
||||
return 0;
|
||||
}
|
||||
if (svc->state == SVC_STOPPING_STATE)
|
||||
return svc;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -158,7 +158,7 @@ void svc_foreach (void (*cb)(svc_t *));
|
||||
void svc_foreach_dynamic (void (*cb)(svc_t *));
|
||||
void svc_foreach_type (int types, void (*cb)(svc_t *));
|
||||
|
||||
int svc_stop_completed (void);
|
||||
svc_t *svc_stop_completed (void);
|
||||
|
||||
void svc_mark_dynamic (void);
|
||||
void svc_check_dirty (svc_t *svc, struct timeval *mtime);
|
||||
|
||||
Reference in new issue
Block a user