aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2012-04-20 14:39:29 +0800
committerChong Yidong2012-04-20 14:39:29 +0800
commitf30d612a7a628828baa7c333629a10295605291b (patch)
tree4ae2ece5cb60bd828d8e0b4657d2912f47a3639c /src
parentcd0f830c2127781a9f9f50ab4a0cb8cd05a66a1f (diff)
downloademacs-f30d612a7a628828baa7c333629a10295605291b.tar.gz
emacs-f30d612a7a628828baa7c333629a10295605291b.zip
Fixes for pty handling in gdb-mi.el and process.c.
* lisp/progmodes/gdb-mi.el (gdb): Revert 2012-04-19 change. (gdb-inferior-io--init-proc): New function. (gdb-init-1): Use it. (gdb-inferior-io-sentinel): New sentinel for the gdb-inferior pty, responsible for allocating a new pty and hooking it to gdb when the old pty gets an EIO due to process exit. (gdb-delchar-or-quit): New command. Bind it in gdb-mi buffers. (gdb-tooltip-print): Don't use obsolete tooltip-use-echo-area. (gdb-inferior-io--maybe-delete-pty): Move into gdb-reset. * src/process.c (wait_reading_process_output): If EIO occurs on a pty, set the status to "failed" and ensure that sentinel is run. * doc/lispref/processes.texi (Asynchronous Processes): Mention nil argument to start-process.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/process.c27
2 files changed, 22 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 00d257e6984..18b6ce1ad64 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-04-20 Chong Yidong <cyd@gnu.org>
2
3 * process.c (wait_reading_process_output): If EIO occurs on a pty,
4 set the status to "failed" and ensure that sentinel is run.
5
12012-04-18 Glenn Morris <rgm@gnu.org> 62012-04-18 Glenn Morris <rgm@gnu.org>
2 7
3 * process.c (Fset_process_inherit_coding_system_flag) 8 * process.c (Fset_process_inherit_coding_system_flag)
diff --git a/src/process.c b/src/process.c
index 3ee22d270e9..f6f1ad0a6fb 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4893,16 +4893,23 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
4893 It can't hurt. */ 4893 It can't hurt. */
4894 else if (nread == -1 && errno == EIO) 4894 else if (nread == -1 && errno == EIO)
4895 { 4895 {
4896 /* Don't do anything if only a pty, with no associated 4896 struct Lisp_Process *p = XPROCESS (proc);
4897 process (bug#10933). */ 4897
4898 if (XPROCESS (proc)->pid != -2) { 4898 /* Clear the descriptor now, so we only raise the
4899 /* Clear the descriptor now, so we only raise the signal 4899 signal once. */
4900 once. */ 4900 FD_CLR (channel, &input_wait_mask);
4901 FD_CLR (channel, &input_wait_mask); 4901 FD_CLR (channel, &non_keyboard_wait_mask);
4902 FD_CLR (channel, &non_keyboard_wait_mask); 4902
4903 4903 if (p->pid == -2)
4904 kill (getpid (), SIGCHLD); 4904 {
4905 } 4905 /* If the EIO occurs on a pty, sigchld_handler's
4906 wait3() will not find the process object to
4907 delete. Do it here. */
4908 p->tick = ++process_tick;
4909 p->status = Qfailed;
4910 }
4911 else
4912 kill (getpid (), SIGCHLD);
4906 } 4913 }
4907#endif /* HAVE_PTYS */ 4914#endif /* HAVE_PTYS */
4908 /* If we can detect process termination, don't consider the 4915 /* If we can detect process termination, don't consider the