1/* ex: set shiftwidth=4 softtabstop=4 expandtab: */ 2#if HAVE_CONFIG_H 3#include <config.h> 4#endif 5 6 7#include <stdio.h> 8#include <stdlib.h> 9#include <string.h> 10#include <compat/dcerpc.h> 11#include "misc.h" 12 13void 14chk_dce_err( 15 error_status_t ecode, 16 const char * where, 17 const char * why, 18 unsigned int fatal) 19{ 20 dce_error_string_t errstr; 21 int error_status; 22 23 if (ecode != error_status_ok) 24 { 25 dce_error_inq_text(ecode, errstr, &error_status); 26 if (error_status == error_status_ok) 27 printf("ERROR. where = <%s> why = <%s> error code = 0x%x " 28 "reason = <%s>\n", 29 where, why, ecode, errstr); 30 else 31 printf("ERROR. where = <%s> why = <%s> error code = 0x%x\n", 32 where, why, ecode); 33 34 if (fatal) exit(1); 35 } 36} 37