- count = SPECPDL_INDEX ();
- record_unwind_protect_nothing ();
- specbind (Qfile_name_handler_alist, Qnil);
- fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false);
- fp = fd < 0 ? 0 : fdopen (fd, "r");
- if (!fp)
- {
- int open_errno = errno;
- emacs_close (fd);
- report_file_errno ("Loading charset map", mapfile, open_errno);
- }
- set_unwind_protect_ptr (count, fclose_unwind, fp);
- unbind_to (count + 1, Qnil);
+ dynwind_begin ();
+ record_unwind_protect_ptr (fclose_ptr_unwind, &fp);
+ {
+ dynwind_begin ();
+ specbind (Qfile_name_handler_alist, Qnil);
+ fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false);
+ fp = fd < 0 ? 0 : fdopen (fd, "r");
+ if (!fp)
+ {
+ int open_errno = errno;
+ emacs_close (fd);
+ report_file_errno ("Loading charset map", mapfile, open_errno);
+ }
+ dynwind_end ();
+ }