If the main casperd process exits, zygote process should exit as well

instead of spinning.

Reported by:	Mikhail <mp@lenta.ru>
This commit is contained in:
pjd 2014-02-09 21:42:01 +00:00
parent 47c0296c2b
commit 9fa72e7466

View File

@ -132,8 +132,13 @@ zygote_main(int sock)
for (;;) { for (;;) {
nvlin = nvlist_recv(sock); nvlin = nvlist_recv(sock);
if (nvlin == NULL) if (nvlin == NULL) {
if (errno == ENOTCONN) {
/* Casperd exited. */
exit(0);
}
continue; continue;
}
func = (zygote_func_t *)(uintptr_t)nvlist_get_number(nvlin, func = (zygote_func_t *)(uintptr_t)nvlist_get_number(nvlin,
"func"); "func");
flags = (int)nvlist_get_number(nvlin, "flags"); flags = (int)nvlist_get_number(nvlin, "flags");