mirror of
https://github.com/troglobit/finit.git
synced 2026-10-04 14:54:14 +07: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:
@@ -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