blob: 474af7cfa3abce79144e9df404e87b8d99fb8a5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
Make the X11 interface work again.
Patch ported from https://github.com/tsutsui/mule1.1-netbsd:
commit 9a72fba7d6302e637008dcde1968e51f5f57321b
Author: tsugutomo enami <enami@tsugutomo-enamis-MacBook-Air.local>
Date: Sat Feb 28 10:46:25 2015 +0900
Copy O_NONBLOCK bit to old_fcntl_flags so that it won't be lost by unrequest_sigio().
--- emacs-18.59-orig/src/ChangeLog
+++ emacs-18.59/src/ChangeLog
@@ -1,3 +1,8 @@
+2018-07-01 Ulrich Müller <ulm@gentoo.org>
+
+ * x11term.c (x_init_1): Save the O_NONBLOCK bit, so that it won't
+ be lost by unrequest_sigio(). Patch from Tsugutomo Enami.
+
2017-12-07 Ulrich Müller <ulm@gentoo.org>
* s-linux.h (SIGSYS): Don't redefine. Fixes compilation with
--- emacs-18.59-orig/src/x11term.c
+++ emacs-18.59/src/x11term.c
@@ -2105,6 +2105,9 @@
#ifdef F_SETOWN
extern int old_fcntl_owner;
#endif
+#if defined(F_SETFL) && defined(FASYNC)
+ extern int old_fcntl_flags;
+#endif
dup2 (ConnectionNumber(XXdisplay), 0);
#ifndef SYSV_STREAMS
@@ -2131,6 +2134,13 @@
fcntl (0, F_SETOWN, getpid ());
#endif /* F_SETOWN_SOCK_NEG */
#endif /* F_SETOWN */
+#if defined(F_SETFL) && defined(FASYNC)
+ /*
+ * Since libxcb sets O_NONBLOCK, copy the bit so that it won't
+ * dropped by unrequest_sigio().
+ */
+ old_fcntl_flags = fcntl (0, F_GETFL, 0) & ~FASYNC;
+#endif
/* Enable interrupt_input because otherwise we cannot asynchronously
detect C-g sent as a keystroke event from the X server. */
|