[hipl-commit] [trunk] Rev 4460: hipd: fix the spec of the command line parser.

  • From: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Tue, 4 May 2010 11:31:05 +0300

Committer: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
Date: 04/05/2010 at 11:31:05
Revision: 4460
Revision-id: mircea.gherzan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  hipd: fix the spec of the command line parser.
  
  Success or failure can hardly be defined in this
  particular context. The only relevant aspect is whether
  the caller should go on or exit(3).

Modified:
  M  hipd/hipd.c

=== modified file 'hipd/hipd.c'
--- hipd/hipd.c 2010-05-03 17:08:15 +0000
+++ hipd/hipd.c 2010-05-04 08:28:27 +0000
@@ -344,8 +344,7 @@
  * @param argc  number of command line parameters
  * @param argc  command line parameters
  * @param flags pointer to the startup flags container
- * @return      0 on success, negative if an option is not recognized or
-                if the user requested the usage message
+ * @return      nonzero if the caller should exit, 0 otherwise
  */
 static int hipd_parse_cmdline_opts(int argc, char *argv[], uint64_t *flags)
 {
@@ -390,7 +389,7 @@
             break;
         case 'V':
             hip_print_version("hipd");
-            return 0;
+            return -1;
         case '?':
         case 'h':
         default:
@@ -844,7 +843,7 @@
      * even without having root privileges.
      */
     if (hipd_parse_cmdline_opts(argc, argv, &sflags)) {
-        return EXIT_FAILURE;
+        return EXIT_SUCCESS;
     }
 
     /* We need to recreate the NAT UDP sockets to bind to the new port. */

Other related posts:

  • » [hipl-commit] [trunk] Rev 4460: hipd: fix the spec of the command line parser. - Mircea Gherzan