Fix v3.1 regression, segfault when inetd service connection exits

The service_step() function may call svc_del() on an svc from the
service_monitor(), so we need a way to tell the latter that it no
longer can dereference the pointer.

This regression is limited to v3.1, due to the introduction of the
new non-shared-memory store of svc_t.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2018-01-10 02:10:14 +01:00
1 parent 89a9d92d6c
commit 68ef6ec108
4 files changed
+19 -11

No files matched your search

+2 -2
View File
@@ -205,7 +205,7 @@ svc_t *svc_job_iterator(svc_t **iter, int first, int job)
* svc_foreach - Run a callback for each registered service
* @cb: Callback to run for each service
*/
void svc_foreach(void (*cb)(svc_t *))
void svc_foreach(int (*cb)(svc_t *))
{
svc_t *svc, *iter = NULL;
@@ -222,7 +222,7 @@ void svc_foreach(void (*cb)(svc_t *))
* @types: Mask of service types
* @cb: Callback to run for each matching type
*/
void svc_foreach_type(int types, void (*cb)(svc_t *))
void svc_foreach_type(int types, int (*cb)(svc_t *))
{
svc_t *svc, *iter = NULL;