fprintf(f,"segmentation fault received\n");
t=time(NULL);
fprintf(f,"Time: %s", ctime(&t));
- file_remap_readonly_all();
+ file_unmap_all();
fprintf(f,"dumping core\n");
fclose(f);
abort();
file_remap_readonly_all(void)
{
struct file *f=file_list;
+ int limit=1000;
- while (f) {
+ while (f && limit-- > 0) {
file_remap_readonly(f);
f=f->next;
}
}
+void
+file_unmap(struct file *f)
+{
+ munmap(f->begin, f->size);
+}
+
+void
+file_unmap_all(void)
+{
+ struct file *f=file_list;
+ int limit=1000;
+
+ while (f && limit-- > 0) {
+ file_unmap(f);
+ f=f->next;
+ }
+}
+
+
+
void *
file_opendir(char *dir)
{
struct file *file_create(char *name);
void file_remap_readonly(struct file *file);
void file_remap_readonly_all(void);
+void file_unmap(struct file *file);
+void file_unmap_all(void);
struct file *file_create_caseinsensitive(char *name);
int file_get_param(struct file *file, struct param_list *param, int count);
void file_destroy(struct file *f);
param_add_hex("Unknown3", str->unknown3, ¶m, &count);
param_add_hex("Type", str->type, ¶m, &count);
param_add_hex("Name-Id", str->nameid, ¶m, &count);
- if (str->segid) {
+ if (str->segid && str->nameid) {
street_name_get_by_id(&name, seg->blk_inf.mdata, str->nameid);
param_add_hex("Len", name.len, ¶m, &count);