diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-04-26 15:20:08 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-04-26 15:20:08 -0400 |
commit | f810a1afe990788cd8f944a515a493902df84ed1 (patch) | |
tree | 145e947530ebdc09476a7aa018ee76644e5f0eb3 /src/or/main.c | |
parent | a7a906603e0c7e3c8519a948b5adf43bfecf6f66 (diff) | |
download | tor-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.c | 10 |
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: |