Changes in uspace/lib/c/generic/assert.c [13f2461:d8de5d3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/assert.c
r13f2461 rd8de5d3 37 37 #include <atomic.h> 38 38 #include <stacktrace.h> 39 #include <stdint.h> 39 40 40 #define MSG_START "Assertion failed (" 41 #define MSG_FILE ") in file \"" 42 #define MSG_LINE "\", line " 43 #define MSG_END ".\n" 41 static atomic_t failed_asserts = {0}; 44 42 45 static atomic_t failed_asserts; 46 47 void assert_abort(const char *cond, const char *file, const char *line) 43 void assert_abort(const char *cond, const char *file, unsigned int line) 48 44 { 49 45 /* 50 46 * Send the message safely to klog. Nested asserts should not occur. 51 47 */ 52 klog_write(MSG_START, str_size(MSG_START)); 53 klog_write(cond, str_size(cond)); 54 klog_write(MSG_FILE, str_size(MSG_FILE)); 55 klog_write(file, str_size(file)); 56 klog_write(MSG_LINE, str_size(MSG_LINE)); 57 klog_write(line, str_size(line)); 58 klog_write(MSG_END, str_size(MSG_END)); 59 48 klog_printf("Assertion failed (%s) in file \"%s\", line %u.\n", 49 cond, file, line); 50 60 51 /* 61 52 * Check if this is a nested or parallel assert. … … 69 60 * assertions. 70 61 */ 71 printf( MSG_START "%s" MSG_FILE "%s" MSG_LINE "%s" MSG_END,62 printf("Assertion failed (%s) in file \"%s\", line %u.\n", 72 63 cond, file, line); 73 64 stacktrace_print(); 74 65 75 66 abort(); 76 67 }
Note:
See TracChangeset
for help on using the changeset viewer.