From 14590f92cf87fdd337646bb8898e9e787d16b562 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 17 Mar 2016 01:11:10 +0000 Subject: [PATCH] [VFATLIB]: Few "adjustments" (inspired from the code of DPRINT1) to diagnose CORE-10932 CORE-10981 #comment Please retest with revision 71016 and make a debug log! svn path=/trunk/; revision=71016 --- reactos/lib/fslib/vfatlib/check/common.c | 16 ++++++++-------- reactos/lib/fslib/vfatlib/check/common.h | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/reactos/lib/fslib/vfatlib/check/common.c b/reactos/lib/fslib/vfatlib/check/common.c index ca1c2c76c20..4782f16cfa8 100644 --- a/reactos/lib/fslib/vfatlib/check/common.c +++ b/reactos/lib/fslib/vfatlib/check/common.c @@ -42,7 +42,7 @@ typedef struct _link { DECLSPEC_NORETURN // __attribute((noreturn)) void exit(int exitcode) { - DbgBreakPoint(); + // DbgBreakPoint(); NtTerminateProcess(NtCurrentProcess(), exitcode); /* Should never get here */ @@ -50,7 +50,7 @@ void exit(int exitcode) } DECLSPEC_NORETURN // __attribute((noreturn)) -void die(const char *msg, ...) +void die_func(const char *msg, ...) // die { va_list args; @@ -59,14 +59,14 @@ void die(const char *msg, ...) DPRINT1("Unrecoverable problem!\n"); VfatPrintV((char*)msg, args); va_end(args); - // fprintf(stderr, "\n"); - VfatPrint("\n"); + // // fprintf(stderr, "\n"); + // VfatPrint("\n"); exit(1); } DECLSPEC_NORETURN // __attribute((noreturn)) -void pdie(const char *msg, ...) +void pdie_func(const char *msg, ...) // pdie { va_list args; @@ -75,9 +75,9 @@ void pdie(const char *msg, ...) DPRINT1("Unrecoverable problem!\n"); VfatPrintV((char*)msg, args); va_end(args); - // fprintf(stderr, ":%s\n", strerror(errno)); - // VfatPrint(":%s\n", strerror(errno)); - VfatPrint("\n"); + // // fprintf(stderr, ":%s\n", strerror(errno)); + // // VfatPrint(":%s\n", strerror(errno)); + // VfatPrint("\n"); exit(1); } diff --git a/reactos/lib/fslib/vfatlib/check/common.h b/reactos/lib/fslib/vfatlib/check/common.h index 22785f8b121..dd4db47d453 100644 --- a/reactos/lib/fslib/vfatlib/check/common.h +++ b/reactos/lib/fslib/vfatlib/check/common.h @@ -28,12 +28,22 @@ #define _COMMON_H DECLSPEC_NORETURN // __attribute((noreturn)) -void die(const char *msg, ...); +// void die(const char *msg, ...); +void die_func(const char *msg, ...); +#define die(msg, ...) \ +do { \ + die_func("DIE! (%s:%d) " msg "\n", __RELFILE__, __LINE__, ##__VA_ARGS__) \ +} while (0) /* Displays a prinf-style message and terminates the program. */ DECLSPEC_NORETURN // __attribute((noreturn)) -void pdie(const char *msg, ...); +// void pdie(const char *msg, ...); +void pdie_func(const char *msg, ...); +#define pdie(msg, ...) \ +do { \ + pdie_func("P-DIE! (%s:%d) " msg "\n", __RELFILE__, __LINE__, ##__VA_ARGS__) \ +} while (0) /* Like die, but appends an error message according to the state of errno. */ -- 2.17.1