From bf90d007d3af93366323adc0763bcfe476e3bbfd Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sun, 9 Feb 2014 21:42:01 +0000 Subject: [PATCH] If the main casperd process exits, zygote process should exit as well instead of spinning. Reported by: Mikhail --- sbin/casperd/zygote.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/casperd/zygote.c b/sbin/casperd/zygote.c index 9591a90a713f..8ca131ad8833 100644 --- a/sbin/casperd/zygote.c +++ b/sbin/casperd/zygote.c @@ -132,8 +132,13 @@ zygote_main(int sock) for (;;) { nvlin = nvlist_recv(sock); - if (nvlin == NULL) + if (nvlin == NULL) { + if (errno == ENOTCONN) { + /* Casperd exited. */ + exit(0); + } continue; + } func = (zygote_func_t *)(uintptr_t)nvlist_get_number(nvlin, "func"); flags = (int)nvlist_get_number(nvlin, "flags");