aboutsummaryrefslogtreecommitdiff
path: root/src/lib/process/process_sys.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2018-12-20 15:07:05 +0100
committerNick Mathewson <nickm@torproject.org>2018-12-21 13:26:38 -0500
commitcf4b3dbd445799bfad21e84777eff91d3a409f21 (patch)
tree36cc1eff732672ec9851f6831f451e931ba7a4c7 /src/lib/process/process_sys.c
parent01819faaba0b4817ce15d29be0944e23268e76c4 (diff)
downloadtor-cf4b3dbd445799bfad21e84777eff91d3a409f21.tar.gz
tor-cf4b3dbd445799bfad21e84777eff91d3a409f21.zip
Use the subsystem list to initialize and shutdown process module.
This patch makes the process module use the subsystem list for initializing and shutting down. See: https://bugs.torproject.org/28847
Diffstat (limited to 'src/lib/process/process_sys.c')
-rw-r--r--src/lib/process/process_sys.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/lib/process/process_sys.c b/src/lib/process/process_sys.c
new file mode 100644
index 0000000000..a880ff146e
--- /dev/null
+++ b/src/lib/process/process_sys.c
@@ -0,0 +1,33 @@
+/* Copyright (c) 2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file process_sys.c
+ * \brief Subsystem object for process setup.
+ **/
+
+#include "orconfig.h"
+#include "lib/subsys/subsys.h"
+#include "lib/process/process_sys.h"
+#include "lib/process/process.h"
+
+static int
+subsys_process_initialize(void)
+{
+ process_init();
+ return 0;
+}
+
+static void
+subsys_process_shutdown(void)
+{
+ process_free_all();
+}
+
+const subsys_fns_t sys_process = {
+ .name = "process",
+ .level = -80,
+ .supported = true,
+ .initialize = subsys_process_initialize,
+ .shutdown = subsys_process_shutdown
+};