From 4aa49410f7e46a106f3ca03b910a3aad60e7f90b Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Fri, 28 Sep 2012 13:06:08 +0000 Subject: [PATCH] - fix --- src/util/getopt.c | 2 ++ src/util/program.c | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/util/getopt.c b/src/util/getopt.c index b5dc3031b..64e4341e6 100644 --- a/src/util/getopt.c +++ b/src/util/getopt.c @@ -940,7 +940,9 @@ GNUNET_GETOPT_run (const char *binaryOptions, GNUNET_free (shorts); GNUNET_free (long_options); if (cont != GNUNET_OK) + { return cont; + } return GNoptind; } diff --git a/src/util/program.c b/src/util/program.c index a1ece1dbd..6045f59cf 100644 --- a/src/util/program.c +++ b/src/util/program.c @@ -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 == GNUNET_NO) ? GNUNET_OK : GNUNET_SYSERR; + return (ret == GNUNET_SYSERR) ? GNUNET_SYSERR : GNUNET_OK; } (void) GNUNET_CONFIGURATION_load (cfg, cc.cfgfile); GNUNET_free (allopts); -- 2.25.1