aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2004-11-25 20:01:39 +0000
committerStefan Monnier <[email protected]>2004-11-25 20:01:39 +0000
commit275464e7a5b740a403e65face0373ad50992887f (patch)
treeb2f058e2fe7699f4b36868fc8dcad36bc2d602dd /src
parent495bf63050e24ad68826f370bfa91ed8f26ccd89 (diff)
(sys_signal): Don't use SA_RESTART if SYNC_INPUT is set.
(emacs_open, emacs_read, emacs_write): Check QUIT when interrupted.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/sysdep.c18
2 files changed, 19 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f8e17d46e3..c9196c5b70 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2004-11-25 Stefan Monnier <[email protected]>
+
+ * sysdep.c (sys_signal): Don't use SA_RESTART if SYNC_INPUT is set.
+ (emacs_open, emacs_read, emacs_write): Check QUIT when interrupted.
+
+ * lread.c (readchar): Check QUIT when `getc' is interrupted.
+
2004-11-24 Richard M. Stallman <[email protected]>
* coding.c (run_pre_post_conversion_on_str): Bind Qinhibit_read_only.
diff --git a/src/sysdep.c b/src/sysdep.c
index b120dcd950..8ce49cd2e9 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1,6 +1,6 @@
/* Interfaces to system-dependent kernel and library entries.
- Copyright (C) 1985, 86,87,88,93,94,95,1999,2000,01,2003
- Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001,
+ 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -2768,12 +2768,16 @@ sys_signal (int signal_number, signal_handler_t action)
struct sigaction new_action, old_action;
sigemptyset (&new_action.sa_mask);
new_action.sa_handler = action;
-#if defined (SA_RESTART) && ! defined (BROKEN_SA_RESTART)
+#if defined (SA_RESTART) && ! defined (BROKEN_SA_RESTART) && !defined(SYNC_INPUT)
/* Emacs mostly works better with restartable system services. If this
flag exists, we probably want to turn it on here.
However, on some systems this resets the timeout of `select'
which means that `select' never finishes if it keeps getting signals.
BROKEN_SA_RESTART is defined on those systems. */
+ /* It's not clear why the comment above says "mostly works better". --Stef
+ When SYNC_INPUT is set, we don't want SA_RESTART because we need to poll
+ for pending input so we need long-running syscalls to be interrupted
+ after a signal that sets the interrupt_input_pending flag. */
new_action.sa_flags = SA_RESTART;
#else
new_action.sa_flags = 0;
@@ -3225,7 +3229,8 @@ emacs_open (path, oflag, mode)
#endif
while ((rtnval = open (path, oflag, mode)) == -1
- && (errno == EINTR));
+ && (errno == EINTR))
+ QUIT;
return (rtnval);
}
@@ -3258,7 +3263,8 @@ emacs_read (fildes, buf, nbyte)
register int rtnval;
while ((rtnval = read (fildes, buf, nbyte)) == -1
- && (errno == EINTR));
+ && (errno == EINTR))
+ QUIT;
return (rtnval);
}
@@ -3279,7 +3285,7 @@ emacs_write (fildes, buf, nbyte)
if (rtnval == -1)
{
if (errno == EINTR)
- continue;
+ { QUIT; continue; }
else
return (bytes_written ? bytes_written : -1);
}