From be3267eb346745d73cfb627c6e962e261a51d6d2 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 2 May 2022 01:59:52 +0000 Subject: [PATCH] Fix race conditions with async input in some Haiku dialogs * src/haikufns.c (Fhaiku_save_session_reply): * src/haikufont.c (Fx_select_font): Block sigio around system calls. --- src/haikufns.c | 2 ++ src/haikufont.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/haikufns.c b/src/haikufns.c index f7c17567b18..04c58c55a76 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -2672,8 +2672,10 @@ call this function yourself. */) reply.quit_reply = !NILP (quit_reply); block_input (); + unrequest_sigio (); write_port (port_emacs_to_session_manager, 0, &reply, sizeof reply); + request_sigio (); unblock_input (); return Qnil; diff --git a/src/haikufont.c b/src/haikufont.c index eb00c8ff381..7f676b87274 100644 --- a/src/haikufont.c +++ b/src/haikufont.c @@ -1109,10 +1109,12 @@ in the font selection dialog. */) error ("Trying to use a menu from within a menu-entry"); popup_activated_p++; + unrequest_sigio (); rc = be_select_font (process_pending_signals, haikufont_should_quit_popup, &family, &style, &size, !NILP (exclude_proportional)); + request_sigio (); popup_activated_p--; if (!rc) -- 2.39.2