projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not include OpenSSL headers directly.
[tinc]
/
src
/
net.c
diff --git
a/src/net.c
b/src/net.c
index
1c267f6
..
99fcb0d
100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-21,8
+21,6
@@
#include "system.h"
#include "system.h"
-#include <openssl/rand.h>
-
#include "utils.h"
#include "splay_tree.h"
#include "conf.h"
#include "utils.h"
#include "splay_tree.h"
#include "conf.h"
@@
-208,7
+206,7
@@
void handle_meta_connection_data(int fd, short events, void *data) {
else {
ifdebug(CONNECTIONS) logger(LOG_DEBUG,
"Error while connecting to %s (%s): %s",
else {
ifdebug(CONNECTIONS) logger(LOG_DEBUG,
"Error while connecting to %s (%s): %s",
- c->name, c->hostname, strerror(result));
+ c->name, c->hostname, s
ocks
trerror(result));
closesocket(c->socket);
do_outgoing_connection(c);
return;
closesocket(c->socket);
do_outgoing_connection(c);
return;
@@
-307,12
+305,19
@@
int main_loop(void) {
timeout_set(&timeout_event, timeout_handler, &timeout_event);
event_add(&timeout_event, &(struct timeval){pingtimeout, 0});
timeout_set(&timeout_event, timeout_handler, &timeout_event);
event_add(&timeout_event, &(struct timeval){pingtimeout, 0});
+
+#ifdef SIGHUP
signal_set(&sighup_event, SIGHUP, sighup_handler, NULL);
signal_add(&sighup_event, NULL);
signal_set(&sighup_event, SIGHUP, sighup_handler, NULL);
signal_add(&sighup_event, NULL);
+#endif
+#ifdef SIGTERM
signal_set(&sigterm_event, SIGTERM, sigterm_handler, NULL);
signal_add(&sigterm_event, NULL);
signal_set(&sigterm_event, SIGTERM, sigterm_handler, NULL);
signal_add(&sigterm_event, NULL);
+#endif
+#ifdef SIGQUIT
signal_set(&sigquit_event, SIGQUIT, sigterm_handler, NULL);
signal_add(&sigquit_event, NULL);
signal_set(&sigquit_event, SIGQUIT, sigterm_handler, NULL);
signal_add(&sigquit_event, NULL);
+#endif
if(event_loop(0) < 0) {
logger(LOG_ERR, "Error while waiting for input: %s", strerror(errno));
if(event_loop(0) < 0) {
logger(LOG_ERR, "Error while waiting for input: %s", strerror(errno));