projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Gracefully exit through the main thread.
[tinc]
/
src
/
net.c
diff --git
a/src/net.c
b/src/net.c
index
3eec9a6
..
e52363e
100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-199,7
+199,7
@@
static void timeout_handler(void *arg) {
if(rand() % 3 == 0) {
logger(LOG_ERR, "Shutting down, check configuration of all nodes for duplicate Names!");
if(rand() % 3 == 0) {
logger(LOG_ERR, "Shutting down, check configuration of all nodes for duplicate Names!");
-
abort()
;
+
running = false
;
return;
}
return;
}
@@
-259,7
+259,7
@@
int reload_configuration(void) {
if(!read_server_config()) {
logger(LOG_ERR, "Unable to reread configuration file, exitting.");
if(!read_server_config()) {
logger(LOG_ERR, "Unable to reread configuration file, exitting.");
-
abort()
;
+
running = false
;
return EINVAL;
}
return EINVAL;
}
@@
-352,8
+352,7
@@
int main_loop(void) {
event_add(&timeout_event);
event_add(&timeout_event);
-
- while(true) {
+ while(running) {
mutex_unlock(&mutex);
usleep(1000000);
mutex_lock(&mutex);
mutex_unlock(&mutex);
usleep(1000000);
mutex_lock(&mutex);