[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[or-cvs] minor bug fix in error checking
Update of /home/or/cvsroot/src/or
In directory moria.seul.org:/tmp/cvs-serv21050/src/or
Modified Files:
config.c
Log Message:
minor bug fix in error checking
Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- config.c 3 Jul 2002 16:53:34 -0000 1.3
+++ config.c 3 Jul 2002 19:58:18 -0000 1.4
@@ -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 @@
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);