LINUX: afs_create infinite fetchStatus loop
[pkg-k5-afs_openafs.git] / src / opr / assert.c
blobe3d3543b3cdab44490e890707807193017e7bba0
1 #include <afsconfig.h>
2 #include <afs/param.h>
4 #include <roken.h>
5 #include "opr.h"
7 #ifdef AFS_NT40_ENV
8 void
9 opr_NTAbort(void)
11 DebugBreak();
13 #endif
15 #define TIMESTAMP_BUFFER_SIZE 26 /* including the null */
16 void
17 opr_AssertionFailed(const char *file, int line)
19 char tdate[TIMESTAMP_BUFFER_SIZE];
20 time_t when;
21 struct tm tm;
23 when = time(NULL);
24 strftime(tdate, sizeof(tdate), "%a %b %d %H:%M:%S %Y",
25 localtime_r(&when, &tm));
26 fprintf(stderr, "%s Assertion failed! file %s, line %d.\n", tdate, file,
27 line);
28 fflush(stderr);
29 opr_abort();
32 void
33 opr_AssertFailU(const char *expr, const char *file, int line)
35 fprintf(stderr, "Fatal Rx error: assertion failed: %s, "
36 "file: %s, line: %d\n",
37 expr, file, line);
38 fflush(stderr);
39 fflush(stdout);
40 opr_abort();