From: Mathieu Desnoyers Date: Sun, 26 Aug 2012 23:11:24 +0000 (-0400) Subject: Fix: make warnings (partial errors) visible X-Git-Tag: v1.0.0-rc5~4 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=24d5af5baa16163265a003b043769806f5852a66;hp=50052405724a3b901b258c00beb424751c579217 Fix: make warnings (partial errors) visible If a partial error happens (some traces cannot be opened), wait for 3 seconds before showing the conversion output, to ensure users can see the warnings. Signed-off-by: Mathieu Desnoyers --- diff --git a/converter/babeltrace.c b/converter/babeltrace.c index c9007c3d..bcc9657e 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -44,6 +44,8 @@ #include /* for clocks */ +#define PARTIAL_ERROR_SLEEP 3 /* 3 seconds */ + #define DEFAULT_FILE_ARRAY_SIZE 1 static char *opt_input_format, *opt_output_format; /* Pointer into const argv */ @@ -572,6 +574,14 @@ int main(int argc, char **argv) goto error_td_write; } + /* + * Errors happened when opening traces, but we continue anyway. + * sleep to let user see the stderr output before stdout. + */ + if (partial_error) { + sleep(PARTIAL_ERROR_SLEEP); + } + ret = convert_trace(td_write, ctx); if (ret) { fprintf(stderr, "Error printing trace.\n\n");