From 98e7e0845d5d5cab6447a94a25ceac5e006df8cf Mon Sep 17 00:00:00 2001 From: Unbit Date: Sun, 19 Jan 2014 08:27:05 +0100 Subject: [PATCH] sub-emperor can be loyal --- core/emperor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/emperor.c b/core/emperor.c index 66f50bc7..4b20c28e 100644 --- a/core/emperor.c +++ b/core/emperor.c @@ -1534,6 +1534,16 @@ void emperor_loop() { uwsgi_hooks_run(uwsgi.hook_emperor_start, "emperor-start", 1); + // signal parent-Emperor about my loyalty + if (uwsgi.has_emperor && !uwsgi.loyal) { + uwsgi_log("announcing my loyalty to the Emperor...\n"); + char byte = 17; + if (write(uwsgi.emperor_fd, &byte, 1) != 1) { + uwsgi_error("write()"); + } + uwsgi.loyal = 1; + } + for (;;) { if (on_royal_death) {