|
From: Bob T. <bt...@us...> - 2003-10-08 04:35:36
|
Update of /cvsroot/benson/benson3/src
In directory sc8-pr-cvs1:/tmp/cvs-serv14708/src
Modified Files:
alertlist.c btrap.c
Log Message:
Made some changes to allow the command line tools to ignore not having a config file.
Index: alertlist.c
===================================================================
RCS file: /cvsroot/benson/benson3/src/alertlist.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** alertlist.c 8 Oct 2003 03:15:02 -0000 1.10
--- alertlist.c 8 Oct 2003 04:35:32 -0000 1.11
***************
*** 62,73 ****
if((rc = load_config()) == ERROR) {
! printf("Error loading configuration file.\n");
! exit(EXIT_FAILURE);
! }
! if((rc = cfg_helper(FIND, "Port", temp)) == ERROR) {
! printf("Configuraton file does not specify a Port and I'm not going to guess.\n");
! exit(EXIT_FAILURE);
} else {
! port = atoi(temp);
}
--- 62,77 ----
if((rc = load_config()) == ERROR) {
! if(!have_destination && !have_source) {
! printf("Error loading configuration file.\n");
! exit(EXIT_FAILURE);
! }
! port = 9021;
} else {
! if((rc = cfg_helper(FIND, "Port", temp)) == ERROR) {
! printf("Configuraton file does not specify a Port and I'm not going to guess.\n");
! exit(EXIT_FAILURE);
! } else {
! port = atoi(temp);
! }
}
Index: btrap.c
===================================================================
RCS file: /cvsroot/benson/benson3/src/btrap.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** btrap.c 8 Oct 2003 02:59:12 -0000 1.19
--- btrap.c 8 Oct 2003 04:35:32 -0000 1.20
***************
*** 59,70 ****
if((rc = load_config()) == ERROR) {
! printf("Error loading configuration file.\n");
! exit(EXIT_FAILURE);
! }
! if((rc = cfg_helper(FIND, "Port", temp)) == ERROR) {
! printf("Configuration file does not specify a Port and I'm not going to guess.\n");
! exit(EXIT_FAILURE);
} else {
! port = atoi(temp);
}
--- 59,74 ----
if((rc = load_config()) == ERROR) {
! if(!have_destination && !have_source) {
! printf("Error loading configuration file.\n");
! exit(EXIT_FAILURE);
! }
! port = 9021; /* guess the default, and pray */
} else {
! if((rc = cfg_helper(FIND, "Port", temp)) == ERROR) {
! printf("Configuration file does not specify a Port and I'm not going to guess.\n");
! exit(EXIT_FAILURE);
! } else {
! port = atoi(temp);
! }
}
|