summaryrefslogtreecommitdiff
path: root/dyn_load.c
diff options
context:
space:
mode:
authorivmai <ivmai>2010-12-02 08:44:04 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:55 +0200
commitda518ec93509c607211f69d1ab0565fe0b663397 (patch)
treef4f570faadb55ccd9e006953c0e5f051722a55dc /dyn_load.c
parent639fb53a03c4620aa199252fff279251daf3d6db (diff)
2010-12-02 Ivan Maidanski <ivmai@mail.ru>
* allchblk.c (GC_freehblk): Print extended error message (done via GC_printf() before aborting with a short message) only if GC_print_stats. * dyn_load.c (GC_register_dynamic_libraries): Ditto. * os_dep.c (GC_get_maps, GC_register_data_segments, GC_remap, PROTECT, GC_write_fault_handler, GC_mprotect_thread): Ditto. * pthread_stop_world.c (GC_start_world): Ditto. * win32_threads.c (GC_register_my_thread_inner): Ditto. * os_dep.c (GC_get_main_stack_base, GC_register_data_segments, GC_dirty_init): Remove redundant print of an error message before aborting with the same message. * os_dep.c (GC_register_data_segments): Remove format specifier from the string passed to GC_err_puts(); use ABORT instead of EXIT (if invalid executable type). * os_dep.c (GC_remap): Adjust printf format specifier (for long type). * os_dep.c (GC_dirty_init): Print a message about SIG_IGN detected (for SIGSEGV/BUS) only if GC_print_stats. * os_dep.c (catch_exception_raise): Join 2 adjucent GC_err_printf calls.
Diffstat (limited to 'dyn_load.c')
-rw-r--r--dyn_load.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/dyn_load.c b/dyn_load.c
index 8893d34..9927a21 100644
--- a/dyn_load.c
+++ b/dyn_load.c
@@ -987,20 +987,20 @@ GC_INNER void GC_register_dynamic_libraries(void)
/* Check status AFTER checking moduleid because */
/* of a bug in the non-shared ldr_next_module stub */
- if (status != 0 ) {
- GC_printf("dynamic_load: status = %d\n", status);
- {
+ if (status != 0) {
+ if (GC_print_stats) {
extern char *sys_errlist[];
extern int sys_nerr;
extern int errno;
+ GC_printf("dynamic_load: status = %d\n", status);
if (errno <= sys_nerr) {
GC_printf("dynamic_load: %s\n", sys_errlist[errno]);
- } else {
- GC_printf("dynamic_load: %d\n", errno);
+ } else {
+ GC_printf("dynamic_load: err_code = %d\n", errno);
}
- }
+ }
ABORT("ldr_next_module failed");
- }
+ }
/* Get the module information */
status = ldr_inq_module(mypid, moduleid, &moduleinfo,
@@ -1083,14 +1083,16 @@ GC_INNER void GC_register_dynamic_libraries(void)
break;
# else
if (errno == EINVAL) {
- break; /* Moved past end of shared library list --> finished */
+ break; /* Moved past end of shared library list --> finished */
} else {
+ if (GC_print_stats) {
if (errno <= sys_nerr) {
- GC_printf("dynamic_load: %s\n", sys_errlist[errno]);
+ GC_printf("dynamic_load: %s\n", sys_errlist[errno]);
} else {
- GC_printf("dynamic_load: %d\n", errno);
+ GC_printf("dynamic_load: err_code = %d\n", errno);
}
- ABORT("shl_get failed");
+ }
+ ABORT("shl_get failed");
}
# endif
}