[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r3804 - in trunk/OpenDNSSEC/signer/src: . daemon

Matthijs Mekking matthijs at nlnetlabs.nl
Thu Aug 26 14:55:59 CEST 2010


Author: matthijs
Date: 2010-08-26 14:55:59 +0200 (Thu, 26 Aug 2010)
New Revision: 3804

Modified:
   trunk/OpenDNSSEC/signer/src/daemon/engine.c
   trunk/OpenDNSSEC/signer/src/ods-signerd.c
Log:
-V for version

Modified: trunk/OpenDNSSEC/signer/src/daemon/engine.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/daemon/engine.c	2010-08-26 12:37:37 UTC (rev 3803)
+++ trunk/OpenDNSSEC/signer/src/daemon/engine.c	2010-08-26 12:55:59 UTC (rev 3804)
@@ -381,7 +381,7 @@
 engine_setup(engine_type* engine)
 {
     struct sigaction action;
-    int result;
+    int result = 0;
 
     se_log_assert(engine);
     se_log_assert(engine->config);
@@ -643,7 +643,7 @@
 start_zonefetcher(engine_type* engine)
 {
     pid_t zfpid = 0;
-    int result;
+    int result = 0;
 
     se_log_assert(engine);
     se_log_assert(engine->config);
@@ -731,7 +731,6 @@
 {
     engine_type* engine = NULL;
     int use_syslog = 0;
-    int result = 0;
 
     se_log_assert(cfgfile);
     se_log_init(NULL, use_syslog, cmdline_verbosity);

Modified: trunk/OpenDNSSEC/signer/src/ods-signerd.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/ods-signerd.c	2010-08-26 12:37:37 UTC (rev 3803)
+++ trunk/OpenDNSSEC/signer/src/ods-signerd.c	2010-08-26 12:55:59 UTC (rev 3804)
@@ -38,6 +38,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+
+#define AUTHOR_NAME "Matthijs Mekking"
+#define COPYRIGHT_STR "Copyright (C) 2008-2010 NLnet Labs OpenDNSSEC"
+
+
 /**
  * Prints usage.
  *
@@ -55,6 +60,7 @@
     fprintf(out, " -h | --help             Show this help and exit.\n");
     fprintf(out, " -i | --info             Print configuration and exit.\n");
     fprintf(out, " -v | --verbose          Increase verbosity.\n");
+    fprintf(out, " -V | --version          Show version and exit.\n");
     fprintf(out, "\nBSD licensed, see LICENSE in source package for "
                  "details.\n");
     fprintf(out, "Version %s. Report bugs to <%s>.\n",
@@ -63,6 +69,23 @@
 
 
 /**
+ * Prints version.
+ *
+ */
+static void
+version(out)
+{
+    fprintf(out, "%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION);
+    fprintf(out, "Written by %s.\n\n", AUTHOR_NAME);
+    fprintf(out, "%s.  This is free software.\n", COPYRIGHT_STR);
+    fprintf(out, "See source files for more license information\n");
+    exit(0);
+}
+
+
+
+
+/**
  * Main. start engine and run it.
  *
  */
@@ -83,11 +106,12 @@
         {"help", no_argument, 0, 'h'},
         {"info", no_argument, 0, 'i'},
         {"verbose", no_argument, 0, 'v'},
+        {"version", no_argument, 0, 'V'},
         { 0, 0, 0, 0}
     };
 
     /* parse the commandline */
-    while ((c=getopt_long(argc, argv, "1c:dhiv",
+    while ((c=getopt_long(argc, argv, "1c:dhivV",
         long_options, &options_index)) != -1) {
         switch (c) {
             case '1':
@@ -106,7 +130,10 @@
             case 'v':
                 cmdline_verbosity++;
                 break;
-            /* version */
+            case 'V':
+                version(stdout);
+                exit(0);
+                break;
             default:
                 usage(stderr);
                 exit(2);




More information about the Opendnssec-commits mailing list