X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fservice.h;h=eed59e621cb3094e34b33df119fa7c607bc1493f;hb=dff52e4261b762fbf7dd69b79b071693ebcf36c9;hp=27c6a37deefd20a9e2edb9ad79fcd58c09679ca7;hpb=100650949c81204d8d52002e028aa8858a406bce;p=oweals%2Fdinit.git diff --git a/src/service.h b/src/service.h index 27c6a37..eed59e6 100644 --- a/src/service.h +++ b/src/service.h @@ -72,12 +72,13 @@ struct OnstartFlags { bool rw_ready : 1; + bool log_ready : 1; // Not actually "onstart" commands: bool no_sigterm : 1; // do not send SIGTERM bool runs_on_console : 1; // run "in the foreground" - OnstartFlags() noexcept : rw_ready(false), + OnstartFlags() noexcept : rw_ready(false), log_ready(false), no_sigterm(false), runs_on_console(false) { } @@ -185,7 +186,7 @@ class ServiceChildWatcher : public EventLoop_t::ChildProcWatcher public: // TODO resolve clunkiness of storing this field ServiceRecord * service; - void gotTermStat(EventLoop_t * eloop, pid_t child, int status) noexcept; + Rearm childStatus(EventLoop_t &eloop, pid_t child, int status) noexcept; ServiceChildWatcher(ServiceRecord * sr) noexcept : service(sr) { } }; @@ -196,14 +197,14 @@ class ServiceIoWatcher : public EventLoop_t::FdWatcher // TODO resolve clunkiness of storing these fields int fd; ServiceRecord * service; - Rearm gotEvent(EventLoop_t * eloop, int fd, int flags) noexcept; + Rearm fdEvent(EventLoop_t &eloop, int fd, int flags) noexcept; ServiceIoWatcher(ServiceRecord * sr) noexcept : service(sr) { } - void registerWith(EventLoop_t *loop, int fd, int flags) + void addWatch(EventLoop_t &loop, int fd, int flags) { this->fd = fd; - EventLoop_t::FdWatcher::registerWith(loop, fd, flags); + EventLoop_t::FdWatcher::addWatch(loop, fd, flags); } }; @@ -679,6 +680,7 @@ class ServiceSet { auto prev_tail = console_queue_tail; console_queue_tail = newTail; + newTail->next_for_console = nullptr; if (! prev_tail) { console_queue_head = newTail; enable_console_log(false);