botan: Encode curve OID and public key in EC private key
[strongswan.git] / src / charon-cmd / charon-cmd.c
index b8f943f..1293ec4 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2005-2013 Martin Willi
  * Copyright (C) 2006 Daniel Roethlisberger
  * Copyright (C) 2005 Jan Hutter
- * Hochschule fuer Technik Rapperswil
+ * HSR Hochschule fuer Technik Rapperswil
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -26,7 +26,6 @@
 #include <errno.h>
 
 #include <library.h>
-#include <hydra.h>
 #include <daemon.h>
 #include <utils/backtrace.h>
 #include <threading/thread.h>
 static level_t default_loglevel = LEVEL_CTRL;
 
 /**
- * Loglevel configuration
- */
-static level_t levels[DBG_MAX];
-
-/**
  * Connection to initiate
  */
 static cmd_connection_t *conn;
@@ -115,6 +109,10 @@ static int run()
                sig = sigwaitinfo(&set, NULL);
                if (sig == -1)
                {
+                       if (errno == EINTR)
+                       {       /* ignore signals we didn't wait for */
+                               continue;
+                       }
                        DBG1(DBG_DMN, "waiting for signal failed: %s", strerror(errno));
                        return 1;
                }
@@ -126,7 +124,7 @@ static int run()
                                         "configuration");
                                if (lib->settings->load_files(lib->settings, lib->conf, FALSE))
                                {
-                                       charon->load_loggers(charon, levels, TRUE);
+                                       charon->load_loggers(charon);
                                        lib->plugins->reload(lib->plugins, NULL);
                                }
                                else
@@ -152,11 +150,6 @@ static int run()
                                charon->bus->alert(charon->bus, ALERT_SHUTDOWN_SIGNAL, sig);
                                return 1;
                        }
-                       default:
-                       {
-                               DBG1(DBG_DMN, "unknown signal %d received. Ignored", sig);
-                               break;
-                       }
                }
        }
 }
@@ -313,6 +306,7 @@ int main(int argc, char *argv[])
 {
        struct sigaction action;
        struct utsname utsname;
+       level_t levels[DBG_MAX];
        int group;
 
        /* handle simple arguments */
@@ -331,11 +325,6 @@ int main(int argc, char *argv[])
                        exit(SS_RC_DAEMON_INTEGRITY);
                }
        }
-       atexit(libhydra_deinit);
-       if (!libhydra_init())
-       {
-               exit(SS_RC_INITIALIZATION_FAILED);
-       }
        atexit(libcharon_deinit);
        if (!libcharon_init())
        {
@@ -345,7 +334,8 @@ int main(int argc, char *argv[])
        {
                levels[group] = default_loglevel;
        }
-       charon->load_loggers(charon, levels, TRUE);
+       charon->set_default_loggers(charon, levels, TRUE);
+       charon->load_loggers(charon);
 
        if (!lookup_uid_gid())
        {