diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-05-04 11:15:55 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-05-04 11:15:55 +0300 |
commit | eba63329da6ccb3bd1f2293affd655575a688c59 (patch) | |
tree | 7c876f65f90abc95278a25ed42d4b04367a5c48c /dyn_load.c | |
parent | 8d954191267082122348ae3b919673d8f3493247 (diff) | |
download | bdwgc-eba63329da6ccb3bd1f2293affd655575a688c59.tar.gz |
Really abort if failed to read /proc for library registration (Linux)
* dyn_load.c [USE_PROC_FOR_LIBRARIES] (GC_register_map_entries):
Change return type from word to void; remove "return 1".
* dyn_load.c [USE_PROC_FOR_LIBRARIES] (GC_register_dynamic_libraries):
Call ABORT() if GC_get_maps() returned null.
* os_dep.c [NEED_PROC_MAPS] (GC_get_maps): Remove outdated comment
(about fn).
Diffstat (limited to 'dyn_load.c')
-rw-r--r-- | dyn_load.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -309,7 +309,7 @@ static void sort_heap_sects(struct HeapSect *base, size_t number_of_elements) } } -STATIC word GC_register_map_entries(char *maps) +STATIC void GC_register_map_entries(char *maps) { char *prot; char *buf_ptr = maps; @@ -327,7 +327,8 @@ STATIC word GC_register_map_entries(char *maps) for (;;) { buf_ptr = GC_parse_map_entry(buf_ptr, &start, &end, &prot, &maj_dev, 0); - if (buf_ptr == NULL) return 1; + if (NULL == buf_ptr) + break; if (prot[1] == 'w') { /* This is a writable mapping. Add it to */ /* the root set unless it is already otherwise */ @@ -394,13 +395,15 @@ STATIC word GC_register_map_entries(char *maps) GC_add_roots_inner((char *)start, (char *)end, TRUE); } } - return 1; } GC_INNER void GC_register_dynamic_libraries(void) { - if (!GC_register_map_entries(GC_get_maps())) + char *maps = GC_get_maps(); + + if (NULL == maps) ABORT("Failed to read /proc for library registration"); + GC_register_map_entries(maps); } /* We now take care of the main data segment ourselves: */ |