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

#define __BEGIN_DECLS
#define __END_DECLS
#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); \
__BEGIN_DECLS void openchange_abort(bool is_fatal)
Definition: fault_util.c:74

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:

1 ==================================
2 OPENCHANGE INTERNAL ERROR: pid 123
3 Message about the error....
4 ==================================
5 Version Samba: 1.2.3
6 Version OpenChange: 1.2.3
7 ==================================
8 BACKTRACE:
9  ....
10  ....
11  ....
12 ==================================
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:

1 OC_PANIC(false, ("Unexpected error, input parameter (`%s`) was wrong", parameter));
2 
3 OC_PANIC(true, ("THIS WILL NEVER HAPPEN, THE END IS NEAR"));
See also
DEBUG()

Referenced by dcesrv_EcDoConnect(), dcesrv_exchange_emsmdb_init(), dcesrv_exchange_nsp_init(), dcesrv_NspiBind(), emsabp_init(), emsmdbp_folder_open_table(), emsmdbp_object_create_folder(), emsmdbp_object_folder_commit_creation(), emsmdbp_object_open_folder(), emsmdbp_object_root_mapistore_folder_set(), emsmdbp_object_table_get_row_props(), and samdb_init().

Function Documentation

void debug_print_backtrace ( int  dbg_level)

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

Referenced by 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/