+
+ return (0);
+
+ /* --- Clean up if things go sideways --- */
+
+fail_3:
+ unlink(sun.sun_path);
+fail_2:
+ close(fd);
+fail_1:
+ umask(omask);
+fail_0:
+ return (-1);
+}
+
+/* --- @a_unlisten@ --- *
+ *
+ * Arguments: ---
+ *
+ * Returns: ---
+ *
+ * Use: Stops listening to the administration socket and removes it.
+ */
+
+void a_unlisten(void)
+{
+ if (!sockname) return;
+ sel_rmfile(&sock);
+ unlink(sockname);
+ close(sock.fd);
+}
+
+/* --- @a_switcherr@ --- *
+ *
+ * Arguments: ---
+ *
+ * Returns: ---
+ *
+ * Use: Arrange to report warnings, trace messages, etc. to
+ * administration clients rather than the standard-error stream.
+ *
+ * Obviously this makes no sense unless there is at least one
+ * client established. Calling @a_listen@ won't help with this,
+ * because the earliest a new client can connect is during the
+ * first select-loop iteration, which is too late: some initial
+ * client must have been added manually using @a_create@.
+ */
+
+void a_switcherr(void)
+{
+ T( trace_custom(a_trace, 0);
+ trace(T_ADMIN, "admin: enabled custom tracing"); )
+ flags |= F_INIT;
+}
+
+/* --- @a_signals@ --- *
+ *
+ * Arguments: ---
+ *
+ * Returns: ---
+ *
+ * Use: Establishes handlers for the obvious signals.
+ */
+
+void a_signals(void)
+{
+ struct sigaction sa;
+
+ sig_add(&s_term, SIGTERM, a_sigdie, 0);
+ sig_add(&s_hup, SIGHUP, a_sighup, 0);
+ sigaction(SIGINT, 0, &sa);
+ if (sa.sa_handler != SIG_IGN)
+ sig_add(&s_int, SIGINT, a_sigdie, 0);
+}
+
+/* --- @a_init@ --- *
+ *
+ * Arguments: ---
+ *
+ * Returns: Zero on success, @-1@ on failure.
+ *
+ * Use: Creates the admin listening socket.
+ */
+
+int a_init(void)
+{
+#ifdef HAVE_LIBADNS
+ int err;
+#endif
+
+ /* --- Prepare the background name resolver --- */
+