summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2014-02-09 21:42:01 +0000
committerpjd <pjd@FreeBSD.org>2014-02-09 21:42:01 +0000
commit9fa72e7466012ab021ef8cc025c315e3807cc024 (patch)
tree3610225c7379bbe3d6c0446d40401d9bce6aad0d
parent47c0296c2b62153d510d292fff5d738f9e4cdb28 (diff)
downloadFreeBSD-src-9fa72e7466012ab021ef8cc025c315e3807cc024.zip
FreeBSD-src-9fa72e7466012ab021ef8cc025c315e3807cc024.tar.gz
If the main casperd process exits, zygote process should exit as well
instead of spinning. Reported by: Mikhail <mp@lenta.ru>
-rw-r--r--sbin/casperd/zygote.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/casperd/zygote.c b/sbin/casperd/zygote.c
index 9591a90..8ca131a 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");
OpenPOWER on IntegriCloud