-dead
[oweals/gnunet.git] / src / util / program.c
index 4e31333e2bbff990585dda4907554a3b773df3a2..6045f59cfe4efa739457bab63745dc02759d7a3b 100644 (file)
@@ -228,9 +228,8 @@ GNUNET_PROGRAM_run2 (int argc, char *const *argv, const char *binaryName,
   lpfx = GNUNET_strdup (binaryName);
   if (NULL != (spc = strstr (lpfx, " ")))
     *spc = '\0';
-  if ((GNUNET_OK !=
-       (ret =
-        GNUNET_GETOPT_run (binaryName, allopts, (unsigned int) argc, argv))) ||
+  ret = GNUNET_GETOPT_run (binaryName, allopts, (unsigned int) argc, argv);
+  if ((GNUNET_OK > ret) ||
       (GNUNET_OK != GNUNET_log_setup (lpfx, loglev, logfile)))
   {
     GNUNET_CONFIGURATION_destroy (cfg);
@@ -239,7 +238,7 @@ GNUNET_PROGRAM_run2 (int argc, char *const *argv, const char *binaryName,
     GNUNET_free_non_null (logfile);
     GNUNET_free (allopts);
     GNUNET_free (lpfx);
-    return ret;
+    return (ret == GNUNET_SYSERR) ? GNUNET_SYSERR : GNUNET_OK;
   }
   (void) GNUNET_CONFIGURATION_load (cfg, cc.cfgfile);
   GNUNET_free (allopts);