aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c
index b7bca471230..44a7d843a29 100644
--- a/src/process.c
+++ b/src/process.c
@@ -211,6 +211,12 @@ static int update_tick;
211#define FD_ZERO(p) (*(p) = 0) 211#define FD_ZERO(p) (*(p) = 0)
212#endif /* no FD_SET */ 212#endif /* no FD_SET */
213 213
214/* If we support X Windows, turn on the code to poll periodically
215 to detect C-g. It isn't actually used when doing interrupt input. */
216#ifdef HAVE_X_WINDOWS
217#define POLL_FOR_INPUT
218#endif
219
214/* Mask of bits indicating the descriptors that we wait for input on */ 220/* Mask of bits indicating the descriptors that we wait for input on */
215 221
216static SELECT_TYPE input_wait_mask; 222static SELECT_TYPE input_wait_mask;
@@ -1485,11 +1491,12 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
1485 struct hostent host_info_fixed; 1491 struct hostent host_info_fixed;
1486 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 1492 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1487 int retry = 0; 1493 int retry = 0;
1494 int count = specpdl_ptr - specpdl;
1488 1495
1489 GCPRO4 (name, buffer, host, service); 1496 GCPRO4 (name, buffer, host, service);
1490 CHECK_STRING (name, 0); 1497 CHECK_STRING (name, 0);
1491 CHECK_STRING (host, 0); 1498 CHECK_STRING (host, 0);
1492 if (XTYPE(service) == Lisp_Int) 1499 if (XTYPE (service) == Lisp_Int)
1493 port = htons ((unsigned short) XINT (service)); 1500 port = htons ((unsigned short) XINT (service));
1494 else 1501 else
1495 { 1502 {
@@ -1543,6 +1550,13 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
1543 if (interrupt_input) 1550 if (interrupt_input)
1544 unrequest_sigio (); 1551 unrequest_sigio ();
1545 1552
1553 /* Slow down polling to every ten seconds.
1554 Some kernels have a bug which causes retrying connect to fail
1555 after a connect. */
1556#ifdef POLL_FOR_INPUT
1557 bind_polling_period (10);
1558#endif
1559
1546 loop: 1560 loop:
1547 if (connect (s, (struct sockaddr *) &address, sizeof address) == -1 1561 if (connect (s, (struct sockaddr *) &address, sizeof address) == -1
1548 && errno != EISCONN) 1562 && errno != EISCONN)
@@ -1567,6 +1581,10 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
1567 Fcons (host, Fcons (name, Qnil))); 1581 Fcons (host, Fcons (name, Qnil)));
1568 } 1582 }
1569 1583
1584#ifdef POLL_FOR_INPUT
1585 unbind_to (count, Qnil);
1586#endif
1587
1570 if (interrupt_input) 1588 if (interrupt_input)
1571 request_sigio (); 1589 request_sigio ();
1572 1590