Changes in src/libcfa/interpose.c [e464759:9d944b2]
- File:
-
- 1 edited
-
src/libcfa/interpose.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/interpose.c
re464759 r9d944b2 26 26 27 27 #include "libhdr/libdebug.h" 28 #include "libhdr/libtools.h"29 28 #include "startup.h" 29 30 void abortf( const char *fmt, ... ) __attribute__ ((__nothrow__, __leaf__, __noreturn__)); 30 31 31 32 void interpose_startup(void) __attribute__(( constructor( STARTUP_PRIORITY_CORE ) )); … … 114 115 static char abort_text[ abort_text_size ]; 115 116 116 extern "C" { 117 void abortf( const char fmt[], ... ) __attribute__ ((__nothrow__, __leaf__, __noreturn__)) { 118 void * kernel_data = kernel_abort(); 117 void abortf( const char fmt[], ... ) __attribute__ ((__nothrow__, __leaf__, __noreturn__)) { 118 void * kernel_data = kernel_abort(); 119 120 int len; 121 122 if( fmt ) { 123 va_list args; 124 va_start( args, fmt ); 119 125 120 int len;126 len = vsnprintf( abort_text, abort_text_size, fmt, args ); 121 127 122 if( fmt ) { 123 va_list args; 124 va_start( args, fmt ); 128 va_end( args ); 125 129 126 len = vsnprintf( abort_text, abort_text_size, fmt, args ); 130 __lib_debug_write( STDERR_FILENO, abort_text, len ); 131 __lib_debug_write( STDERR_FILENO, "\n", 1 ); 132 } 127 133 128 va_end( args ); 129 130 __lib_debug_write( STDERR_FILENO, abort_text, len ); 131 __lib_debug_write( STDERR_FILENO, "\n", 1 ); 132 } 133 134 len = snprintf( abort_text, abort_text_size, "Cforall Runtime error (UNIX pid:%ld)\n", (long int)getpid() ); // use UNIX pid (versus getPid) 135 __lib_debug_write( STDERR_FILENO, abort_text, len ); 134 len = snprintf( abort_text, abort_text_size, "Cforall Runtime error (UNIX pid:%ld)\n", (long int)getpid() ); // use UNIX pid (versus getPid) 135 __lib_debug_write( STDERR_FILENO, abort_text, len ); 136 136 137 137 138 kernel_abort_msg( kernel_data, abort_text, abort_text_size );138 kernel_abort_msg( kernel_data, abort_text, abort_text_size ); 139 139 140 libc_abort(); 141 } 140 libc_abort(); 142 141 }
Note:
See TracChangeset
for help on using the changeset viewer.