From f91ff99a72c8d988ccd192719fc8ac4c3cf09d4b Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 12 Dec 2013 23:27:06 +0000 Subject: [PATCH] - Flush debug streams before exiting process git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4698 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- common/utils/assertions.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/utils/assertions.h b/common/utils/assertions.h index 2ede7cfb83..3ce939c96c 100644 --- a/common/utils/assertions.h +++ b/common/utils/assertions.h @@ -42,6 +42,8 @@ do { \ fprintf(stderr, #vALUE1": %"PRIdMAX"\n"#vALUE2": %"PRIdMAX"\n"#vALUE3": %"PRIdMAX"\n", \ (intmax_t)vALUE1, (intmax_t)vALUE2, (intmax_t)vALUE3); \ fprintf(stderr, "Exiting execution\n"); \ + fflush(stdout); \ + fflush(stderr); \ abort(); \ } \ } while(0) @@ -55,6 +57,8 @@ do { \ #vALUE4": %"PRIdMAX"\n", \ (intmax_t)vALUE1, (intmax_t)vALUE2, (intmax_t)vALUE3, (intmax_t)vALUE4); \ fprintf(stderr, "Exiting execution\n"); \ + fflush(stdout); \ + fflush(stderr); \ exit(EXIT_FAILURE); \ } \ } while(0) @@ -68,6 +72,8 @@ do { \ fprintf(stderr, "%s:%d:%s Assertion `"#cOND"` failed\n", \ __FILE__, __LINE__, __FUNCTION__); \ fprintf(stderr, "Exiting execution\n"); \ + fflush(stdout); \ + fflush(stderr); \ abort(); \ } \ } while(0) @@ -77,6 +83,8 @@ do { \ fprintf(stderr, "%s:%d:%s Execution interrupted: `"#mESSAGE"`.\n", \ __FILE__, __LINE__, __FUNCTION__); \ fprintf(stderr, "Exiting execution\n"); \ + fflush(stdout); \ + fflush(stderr); \ abort(); \ } while(0) -- GitLab