fault_util.h File Reference

Macros

#define __BEGIN_DECLS
 
#define __END_DECLS
 
#define OC_PANIC(is_fatal, body)
 Report an unexpected nasty error that should not happen. More...
 

Functions

void debug_print_backtrace (int dbg_level)
 
__BEGIN_DECLS void openchange_abort (bool is_fatal)
 

Macro Definition Documentation

◆ __BEGIN_DECLS

#define __BEGIN_DECLS

◆ __END_DECLS

#define __END_DECLS

◆ OC_PANIC

#define OC_PANIC (   is_fatal,
  body 
)
Value:
fprintf(stderr,"\n"); \
fprintf(stderr, "OPENCHANGE INTERNAL ERROR: pid %d\n", (int)getpid()); \
fprintf(stderr, body); \
fflush(stderr); \
openchange_abort(is_fatal);

Report an unexpected nasty error that should not happen.

It will print information about the error and if is_fatal is true abort() will be called.

DEBUG macro will not be used to print a report with the following format:

==================================
OPENCHANGE INTERNAL ERROR: pid 123
Message about the error....
==================================
Version Samba: 1.2.3
Version OpenChange: 1.2.3
==================================
BACKTRACE:
....
....
....
==================================
Parameters
[in]is_fatalBoolean to indicate the error is fatal. If it is true abort() will be called, false will have no effect.
[in]bodyText to print out using DEBUG(0, body) macro.

Examples:

OC_PANIC(false, ("Unexpected error, input parameter (`%s`) was wrong", parameter));
OC_PANIC(true, ("THIS WILL NEVER HAPPEN, THE END IS NEAR"));
#define OC_PANIC(is_fatal, body)
Report an unexpected nasty error that should not happen.
Definition: fault_util.h:61
See also
DEBUG()

Function Documentation

◆ debug_print_backtrace()

void debug_print_backtrace ( int  dbg_level)

print a backtrace (not using DEBUG() macro).

Referenced by openchange_abort().

◆ openchange_abort()

__BEGIN_DECLS void openchange_abort ( bool  is_fatal)

Handle Openchange calls. Depending on configuration and severity it may really abort() or just skip it

References debug_print_backtrace().


Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/