X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincd.c;h=2e607b67c7195013b87b9c8b7035524f929239ab;hb=ec12269355f7979fdc0783dc15d109832f1e83cd;hp=a220154b79be239d4d5c775ee6124bc4e0ae8922;hpb=a26d371d0df3bee1bdc6e9d7046e949ee29e6de7;p=tinc diff --git a/src/tincd.c b/src/tincd.c index a220154b..2e607b67 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: tincd.c,v 1.10.4.18 2000/10/29 02:07:41 guus Exp $ + $Id: tincd.c,v 1.10.4.20 2000/10/29 22:10:44 guus Exp $ */ #include "config.h" @@ -33,6 +33,7 @@ #include #include #include +#include #include #ifdef HAVE_SYS_IOCTL_H @@ -44,7 +45,6 @@ #include #include "conf.h" -#include "encr.h" #include "net.h" #include "netutl.h" #include "protocol.h" @@ -252,7 +252,7 @@ int detach(void) if(pid) /* parent process */ { signal(SIGTERM, parent_exit); -// sleep(600); /* wait 10 minutes */ + sleep(600); /* wait 10 minutes */ exit(1); } } @@ -437,17 +437,16 @@ main(int argc, char **argv, char **envp) if(detach()) exit(0); -/* FIXME: wt* is this suppose to do? - if(security_init()) - return 1; -*/ + if(debug_lvl >= DEBUG_ERROR) + ERR_load_crypto_strings(); + for(;;) { if(!setup_network_connections()) { main_loop(); cleanup_and_exit(1); - } + } syslog(LOG_ERR, _("Unrecoverable error")); cp_trace(); @@ -470,6 +469,7 @@ sigterm_handler(int a) { if(debug_lvl > DEBUG_NOTHING) syslog(LOG_NOTICE, _("Got TERM signal")); + cleanup_and_exit(0); }