From: Davin McCall Date: Fri, 26 Oct 2018 09:23:41 +0000 (+0100) Subject: Add a few comments. X-Git-Tag: v0.5.0~47 X-Git-Url: https://git.librecmc.org/?p=oweals%2Fdinit.git;a=commitdiff_plain;h=035e35da8af47bde9032eed505d5295c7e76e86d Add a few comments. --- 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) {