From 24cb645304990a4c3edd4dfb0c9ec4e4ea07b8d7 Mon Sep 17 00:00:00 2001 From: Lucas Schnorr Date: Mon, 23 Jan 2012 00:34:52 +0100 Subject: [PATCH] [trace] be more strict about errors --- src/instr/instr_config.c | 18 +++++++++++------- src/instr/instr_paje_trace.c | 4 +++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c index e91a964db4..d987722eff 100644 --- a/src/instr/instr_config.c +++ b/src/instr/instr_config.c @@ -73,7 +73,9 @@ int TRACE_start() TRACE_paje_start(); /* activate trace */ - xbt_assert (trace_active==0, "Tracing is already active."); + if (trace_active == 1){ + THROWF (tracing_error, 0, "Tracing is already active"); + } trace_active = 1; XBT_DEBUG ("Tracing is on"); @@ -395,9 +397,10 @@ void TRACE_generate_triva_uncat_conf (void) char *name, *value; FILE *file = fopen (output, "w"); - xbt_assert (file != NULL, - "Unable to open file (%s) for writing triva graph " - "configuration (uncategorized).", output); + if (file == NULL){ + THROWF (system_error, 1, "Unable to open file (%s) for writing triva graph " + "configuration (uncategorized).", output); + } //open fprintf (file, "{\n"); @@ -451,9 +454,10 @@ void TRACE_generate_triva_cat_conf (void) } FILE *file = fopen (output, "w"); - xbt_assert (file != NULL, - "Unable to open file (%s) for writing triva graph " - "configuration (categorized).", output); + if (file == NULL){ + THROWF (system_error, 1, "Unable to open file (%s) for writing triva graph " + "configuration (categorized).", output); + } //open fprintf (file, "{\n"); diff --git a/src/instr/instr_paje_trace.c b/src/instr/instr_paje_trace.c index c4a7cbed50..b994510a87 100644 --- a/src/instr/instr_paje_trace.c +++ b/src/instr/instr_paje_trace.c @@ -155,7 +155,9 @@ void TRACE_paje_start(void) { char *filename = TRACE_get_filename(); tracing_file = fopen(filename, "w"); - xbt_assert (tracing_file != NULL, "Tracefile %s could not be opened for writing.", filename); + if (tracing_file == NULL){ + THROWF (system_error, 1, "Tracefile %s could not be opened for writing.", filename); + } XBT_DEBUG("Filename %s is open for writing", filename); -- 2.20.1