GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPROSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
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);
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;
+ }
+ if (GNUNET_YES ==
+ GNUNET_DISK_file_test (cc.cfgfile))
+ (void) GNUNET_CONFIGURATION_load (cfg, cc.cfgfile);
+ else
+ {
+ (void) GNUNET_CONFIGURATION_load (cfg, NULL);
+ if (0 != strcmp (cc.cfgfile, GNUNET_DEFAULT_USER_CONFIG_FILE))
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Could not access configuration file `%s'\n"),
+ cc.cfgfile);
}
- (void) GNUNET_CONFIGURATION_load (cfg, cc.cfgfile);
GNUNET_free (allopts);
GNUNET_free (lpfx);
if (GNUNET_OK ==