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:
Pawel Jakub Dawidek 2014-02-09 21:42:01 +00:00
parent 897f2a3892
commit bf90d007d3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261692

View File

@ -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");