diff options
author | Bruce Montrose <montrose@itd.nrl.navy.mil> | 2002-07-03 19:58:18 +0000 |
---|---|---|
committer | Bruce Montrose <montrose@itd.nrl.navy.mil> | 2002-07-03 19:58:18 +0000 |
commit | bb163ca83054c2d2c8f36b06f7bda1806ba1d38d (patch) | |
tree | 806304ba74f03db566611f52fcf016dec45b0bd0 | |
parent | 66c6f2231ec1ac5b3249aa144400d951c0dca47f (diff) | |
download | tor-bb163ca83054c2d2c8f36b06f7bda1806ba1d38d.tar tor-bb163ca83054c2d2c8f36b06f7bda1806ba1d38d.tar.gz |
minor bug fix in error checking
svn:r28
-rw-r--r-- | src/or/config.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/or/config.c b/src/or/config.c index fbe071520..619f6497a 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -8,6 +8,9 @@ /* * Changes : * $Log$ + * Revision 1.4 2002/07/03 19:58:18 montrose + * minor bug fix in error checking + * * Revision 1.3 2002/07/03 16:53:34 montrose * added error checking into getoptions() * @@ -104,24 +107,26 @@ RETURN VALUE: 0 on success, non-zero on error code = poptReadOptions(optCon,ConfigFile); else /* load Default configuration files */ code = poptReadDefaultOptions(cmd,optCon); - - if ( Verbose ) /* display options upon user request */ - { - printf("\nLogLevel=%s\n",options->LogLevel); - printf("RouterFile=%s, PrivateKeyFile=%s\n",options->RouterFile,options->PrivateKeyFile); - printf("ORPort=%d, OPPort=%d, APPort=%d\n",options->ORPort,options->OPPort,options->APPort); - printf("CoinWeight=%6.4f, MaxConn=%d, TrafficShaping=%d\n\n",options->CoinWeight,options->MaxConn,options->TrafficShaping); - } } switch(code) /* error checking */ { case INT_MIN: fprintf(stderr, "%s: Unable to open configuration file.\n", ConfigFile); + break; case -1: + if ( Verbose ) /* display options upon user request */ + { + printf("\nLogLevel=%s\n",options->LogLevel); + printf("RouterFile=%s, PrivateKeyFile=%s\n",options->RouterFile,options->PrivateKeyFile); + printf("ORPort=%d, OPPort=%d, APPort=%d\n",options->ORPort,options->OPPort,options->APPort); + printf("CoinWeight=%6.4f, MaxConn=%d, TrafficShaping=%d\n\n",options->CoinWeight,options->MaxConn,options->TrafficShaping); + } code = 0; + break; default: fprintf(stderr, "%s: %s\n", poptBadOption(optCon, POPT_BADOPTION_NOALIAS), poptStrerror(code)); + break; } poptFreeContext(optCon); |