{
struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
Lisp_Object frame, tail;
- ptrdiff_t idx = SPECPDL_INDEX ();
+ dynwind_begin ();
error_msg = alloca (strlen (error_message) + 1);
strcpy (error_msg, error_message);
totally_unblock_input ();
- unbind_to (idx, Qnil);
+ dynwind_end ();
clear_waiting_for_input ();
/* Tell GCC not to suggest attribute 'noreturn' for this function. */