[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r5324 - branches/OpenDNSSEC-1.2/signer/src/daemon

Matthijs Mekking matthijs at nlnetlabs.nl
Wed Jul 13 15:57:13 CEST 2011


Author: matthijs
Date: 2011-07-13 15:57:13 +0200 (Wed, 13 Jul 2011)
New Revision: 5324

Modified:
   branches/OpenDNSSEC-1.2/signer/src/daemon/cfg.c
   branches/OpenDNSSEC-1.2/signer/src/daemon/cfg.h
   branches/OpenDNSSEC-1.2/signer/src/daemon/cmdhandler.c
   branches/OpenDNSSEC-1.2/signer/src/daemon/cmdhandler.h
   branches/OpenDNSSEC-1.2/signer/src/daemon/engine.c
   branches/OpenDNSSEC-1.2/signer/src/daemon/signal.h
Log:
backport changes 1.3 (#1)



Modified: branches/OpenDNSSEC-1.2/signer/src/daemon/cfg.c
===================================================================
--- branches/OpenDNSSEC-1.2/signer/src/daemon/cfg.c	2011-07-12 14:22:34 UTC (rev 5323)
+++ branches/OpenDNSSEC-1.2/signer/src/daemon/cfg.c	2011-07-13 13:57:13 UTC (rev 5324)
@@ -39,8 +39,8 @@
 #include "util/se_malloc.h"
 
 #include <errno.h>
-#include <stdio.h> /* fprintf() */
-#include <string.h> /* strerror() */
+#include <stdio.h>
+#include <string.h>
 
 
 /**
@@ -108,6 +108,14 @@
         se_log_error("engine config does not exist");
         return 1;
     }
+    if (!config->zonelist_filename) {
+        se_log_error("config-check failed: no zonelist filename");
+        return 1;
+    }
+    if (!config->clisock_filename) {
+        se_log_error("config-check failed: no socket filename");
+        return 1;
+    }
 
     /* room for more checks here */
 
@@ -122,11 +130,11 @@
 void
 engine_config_print(FILE* out, engineconfig_type* config)
 {
-    se_log_assert(out);
-    se_log_debug("print config");
+    if (!out) {
+        return;
+    }
 
     fprintf(out, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
-
     if (config) {
         fprintf(out, "<Configuration>\n");
 
@@ -192,13 +200,12 @@
            - clisock_filename
          */
     }
-
     return;
 }
 
 
 /**
- * Clean up engine configuration.
+ * Clean up config.
  *
  */
 void
@@ -254,6 +261,6 @@
     } else {
         se_log_warning("cleanup empty config");
     }
-
     return;
 }
+

Modified: branches/OpenDNSSEC-1.2/signer/src/daemon/cfg.h
===================================================================
--- branches/OpenDNSSEC-1.2/signer/src/daemon/cfg.h	2011-07-12 14:22:34 UTC (rev 5323)
+++ branches/OpenDNSSEC-1.2/signer/src/daemon/cfg.h	2011-07-13 13:57:13 UTC (rev 5324)
@@ -88,7 +88,7 @@
 void engine_config_print(FILE* out, engineconfig_type* config);
 
 /**
- * Clean up engine configuration.
+ * Clean up config.
  * \param[in] config engine configuration
  *
  */

Modified: branches/OpenDNSSEC-1.2/signer/src/daemon/cmdhandler.c
===================================================================
--- branches/OpenDNSSEC-1.2/signer/src/daemon/cmdhandler.c	2011-07-12 14:22:34 UTC (rev 5323)
+++ branches/OpenDNSSEC-1.2/signer/src/daemon/cmdhandler.c	2011-07-13 13:57:13 UTC (rev 5324)
@@ -39,19 +39,18 @@
 #include "util/se_malloc.h"
 
 #include <errno.h>
-#include <fcntl.h> /* fcntl() */
-#include <ldns/ldns.h> /* ldns_rbtree_*() */
-#include <stdio.h> /* snprintf() */
-#include <stdlib.h> /* atoi() */
-#include <string.h> /* strncpy(), strerror(), strlen(), strncmp() */
-#include <strings.h> /* bzero() */
-#include <sys/select.h> /* select(), FD_ZERO(), FD_SET(), FD_ISSET() */
-#include <sys/socket.h> /* socket(), listen(), bind(), accept() */
+#include <fcntl.h>
+#include <ldns/ldns.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <sys/select.h>
+#include <sys/socket.h>
 #ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#include <unistd.h> /* fcntl(), close(), unlink(), read() */
-
+#include <unistd.h>
 /* According to earlier standards: select() sys/time.h sys/types.h unistd.h */
 #include <sys/time.h>
 #include <sys/types.h>
@@ -90,6 +89,7 @@
         "update <zone>   update this zone signer configurations.\n"
         "update [--all]  update zone list and all signer configurations.\n"
         "start           start the engine.\n"
+        "running         check if the engine is running.\n"
         "reload          reload the engine.\n"
         "stop            stop the engine.\n"
         "verbosity <nr>  set verbosity.\n"

Modified: branches/OpenDNSSEC-1.2/signer/src/daemon/cmdhandler.h
===================================================================
--- branches/OpenDNSSEC-1.2/signer/src/daemon/cmdhandler.h	2011-07-12 14:22:34 UTC (rev 5323)
+++ branches/OpenDNSSEC-1.2/signer/src/daemon/cmdhandler.h	2011-07-13 13:57:13 UTC (rev 5324)
@@ -57,7 +57,7 @@
 /**
  * Create command handler.
  * \param[in] filename socket file name
- * \return cmdhandler_type* the created command handler
+ * \return cmdhandler_type* created command handler
  *
  */
 cmdhandler_type* cmdhandler_create(const char* filename);
@@ -70,8 +70,8 @@
 void cmdhandler_start(cmdhandler_type* cmdhandler);
 
 /**
- * Clean up command handler.
- * \param[in] cmdhandler_type* clean up this command handler
+ * Cleanup command handler.
+ * \param[in] cmdhandler_type* command handler
  *
  */
 void cmdhandler_cleanup(cmdhandler_type* cmdhandler);

Modified: branches/OpenDNSSEC-1.2/signer/src/daemon/engine.c
===================================================================
--- branches/OpenDNSSEC-1.2/signer/src/daemon/engine.c	2011-07-12 14:22:34 UTC (rev 5323)
+++ branches/OpenDNSSEC-1.2/signer/src/daemon/engine.c	2011-07-13 13:57:13 UTC (rev 5324)
@@ -48,18 +48,18 @@
 #include "util/se_malloc.h"
 
 #include <errno.h>
-#include <libhsm.h> /* hsm_open(), hsm_close() */
-#include <libxml/parser.h> /* xmlInitParser(), xmlCleanupParser(), xmlCleanupThreads() */
-#include <signal.h> /* sigfillset(), sigaction(), kill() */
-#include <stdio.h> /* snprintf() */
-#include <stdlib.h> /* exit(), fwrite() */
-#include <string.h> /* strlen(), strncpy(), strerror() */
-#include <strings.h> /* bzero() */
-#include <sys/socket.h> /* socket(), connect(), close()  */
-#include <sys/types.h> /* getpid(), kill() */
-#include <sys/un.h> /* unix socket */
-#include <time.h> /* tzset() */
-#include <unistd.h> /* fork(), setsid(), getpid(), chdir() */
+#include <libhsm.h>
+#include <libxml/parser.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/un.h>
+#include <time.h>
+#include <unistd.h>
 
 
 /**
@@ -92,7 +92,7 @@
 
 
 /**
- * Start command handler thread.
+ * Start command handler.
  *
  */
 static void*
@@ -104,25 +104,16 @@
     cmdhandler_start(cmd);
     return NULL;
 }
-
-
-/**
- * Start command handler.
- *
- */
 static int
 engine_start_cmdhandler(engine_type* engine)
 {
     se_log_assert(engine);
     se_log_debug("start command handler");
-
     engine->cmdhandler->engine = engine;
     se_thread_create(&engine->cmdhandler->thread_id,
         cmdhandler_thread_start, engine->cmdhandler);
     return 0;
 }
-
-
 /**
  * Self pipe trick (see Unix Network Programming).
  *
@@ -163,8 +154,6 @@
     }
     return 0;
 }
-
-
 /**
  * Stop command handler.
  *

Modified: branches/OpenDNSSEC-1.2/signer/src/daemon/signal.h
===================================================================
--- branches/OpenDNSSEC-1.2/signer/src/daemon/signal.h	2011-07-12 14:22:34 UTC (rev 5323)
+++ branches/OpenDNSSEC-1.2/signer/src/daemon/signal.h	2011-07-13 13:57:13 UTC (rev 5324)
@@ -50,8 +50,7 @@
  * \param[in] engine corresponding engine
  *
  */
-void
-signal_set_engine(struct engine_struct* engine);
+void signal_set_engine(struct engine_struct* engine);
 
 /**
  * Handle signals.




More information about the Opendnssec-commits mailing list