summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-04-26 15:20:08 -0400
committerNick Mathewson <nickm@torproject.org>2011-04-26 15:20:08 -0400
commitf810a1afe990788cd8f944a515a493902df84ed1 (patch)
tree145e947530ebdc09476a7aa018ee76644e5f0eb3 /src/or/main.c
parenta7a906603e0c7e3c8519a948b5adf43bfecf6f66 (diff)
downloadtor-f810a1afe990788cd8f944a515a493902df84ed1.tar.gz
tor-f810a1afe990788cd8f944a515a493902df84ed1.zip
Expose a new process_signal(uintptr_t), not signal_callback()
This is a tweak to the bug2917 fix. Basically, if we want to simulate a signal arriving in the controller, we shouldn't have to pretend that we're Libevent, or depend on how Tor sets up its Libevent callbacks.
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 5e4d88cf96..169956849c 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1578,12 +1578,20 @@ do_main_loop(void)
/** Libevent callback: invoked when we get a signal.
*/
-void
+static void
signal_callback(int fd, short events, void *arg)
{
uintptr_t sig = (uintptr_t)arg;
(void)fd;
(void)events;
+
+ process_signal(sig);
+}
+
+/** Do the work of acting on a signal received in <b>sig</b> */
+void
+process_signal(uintptr_t sig)
+{
switch (sig)
{
case SIGTERM: