Hi,
--- a/standalone.c
+++ b/standalone.c
@@ -228,7 +228,7 @@ vsf_standalone_main(void)
die("accept");
}
- ++s_children;
+ __sync_fetch_and_add(&s_children, 1);
@@ -251,7 +251,7 @@ vsf_standalone_main(void)
/* fork() failed, drop the count back out */
drop_ip_count(p_raw_addr);
- --s_children;
+ __sync_fetch_and_sub(&s_children, 1);
@@ -302,7 +302,7 @@ handle_sigchld(void* duff)
/* Account for the child dying */
- --s_children;
+ __sync_fetch_and_sub(&s_children, 1);
FWIW, I pinged Chris Evans to confirm the provenance of this patch, and
it was indeed provided by Chris to fix this specific bug.
--
Athos Ribeiro