From 035e35da8af47bde9032eed505d5295c7e76e86d Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Fri, 26 Oct 2018 10:23:41 +0100 Subject: [PATCH] Add a few comments. --- src/dinit.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dinit.cc b/src/dinit.cc index 25d0c24..d6911b2 100644 --- a/src/dinit.cc +++ b/src/dinit.cc @@ -103,6 +103,7 @@ const char * get_user_home() namespace { + // Event-loop handler for a signal, which just delegates to a function (pointer). class callback_signal_handler : public eventloop_t::signal_watcher_impl { using rearm = dasynq::rearm; @@ -129,6 +130,7 @@ namespace { } }; + // Event-loop handler for when a connection is made to the control socket. class control_socket_watcher : public eventloop_t::fd_watcher_impl { using rearm = dasynq::rearm; @@ -507,6 +509,7 @@ int dinit_main(int argc, char **argv) return 0; } +// Log a parse error when reading the environment file. static void log_bad_env(int linenum) { log(loglevel_t::ERROR, "invalid environment variable setting in environment file (line ", linenum, ")"); @@ -597,6 +600,9 @@ static void control_socket_cb(eventloop_t *loop, int sockfd) } } +// Open/create the control socket, normally /dev/dinitctl, used to allow client programs to connect +// and issue service orders and shutdown commands etc. This can safely be called multiple times; +// once the socket has been successfully opened, further calls have no effect. void open_control_socket(bool report_ro_failure) noexcept { if (! control_socket_open) { -- 2.25.1