Commit 44561ddd authored by Jonathan Jenkins's avatar Jonathan Jenkins

tweaked config error handling

parent 03a26bd6
...@@ -730,7 +730,7 @@ static void loggp_configure(){ ...@@ -730,7 +730,7 @@ static void loggp_configure(){
const char * anno = anno_map->annotations[i]; const char * anno = anno_map->annotations[i];
int rc = configuration_get_value_relpath(&config, "PARAMS", int rc = configuration_get_value_relpath(&config, "PARAMS",
"net_config_file", anno, config_file, MAX_NAME_LENGTH); "net_config_file", anno, config_file, MAX_NAME_LENGTH);
if (rc == 0){ if (rc <= 0){
tw_error(TW_LOC, "unable to read PARAMS:net_config_file@%s", tw_error(TW_LOC, "unable to read PARAMS:net_config_file@%s",
anno); anno);
} }
...@@ -739,7 +739,7 @@ static void loggp_configure(){ ...@@ -739,7 +739,7 @@ static void loggp_configure(){
if (anno_map->has_unanno_lp > 0){ if (anno_map->has_unanno_lp > 0){
int rc = configuration_get_value_relpath(&config, "PARAMS", int rc = configuration_get_value_relpath(&config, "PARAMS",
"net_config_file", NULL, config_file, MAX_NAME_LENGTH); "net_config_file", NULL, config_file, MAX_NAME_LENGTH);
if (rc == 0){ if (rc <= 0){
tw_error(TW_LOC, "unable to read PARAMS:net_config_file"); tw_error(TW_LOC, "unable to read PARAMS:net_config_file");
} }
loggp_set_params(config_file, &all_params[anno_map->num_annos]); loggp_set_params(config_file, &all_params[anno_map->num_annos]);
......
...@@ -867,7 +867,7 @@ static void sp_read_config(const char * anno, simplep2p_param *p){ ...@@ -867,7 +867,7 @@ static void sp_read_config(const char * anno, simplep2p_param *p){
int rc; int rc;
rc = configuration_get_value_relpath(&config, "PARAMS", rc = configuration_get_value_relpath(&config, "PARAMS",
"net_latency_ns_file", anno, latency_file, MAX_NAME_LENGTH); "net_latency_ns_file", anno, latency_file, MAX_NAME_LENGTH);
if (rc == 0){ if (rc <= 0){
if (anno == NULL) if (anno == NULL)
tw_error(TW_LOC, tw_error(TW_LOC,
"simplep2p: unable to read PARAMS:net_latency_ns_file"); "simplep2p: unable to read PARAMS:net_latency_ns_file");
...@@ -878,7 +878,7 @@ static void sp_read_config(const char * anno, simplep2p_param *p){ ...@@ -878,7 +878,7 @@ static void sp_read_config(const char * anno, simplep2p_param *p){
} }
rc = configuration_get_value_relpath(&config, "PARAMS", "net_bw_mbps_file", rc = configuration_get_value_relpath(&config, "PARAMS", "net_bw_mbps_file",
anno, bw_file, MAX_NAME_LENGTH); anno, bw_file, MAX_NAME_LENGTH);
if (rc == 0){ if (rc <= 0){
if (anno == NULL) if (anno == NULL)
tw_error(TW_LOC, tw_error(TW_LOC,
"simplep2p: unable to read PARAMS:net_bw_mbps_file"); "simplep2p: unable to read PARAMS:net_bw_mbps_file");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment