aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/process.c b/src/process.c
index 7b21d060cf8..5b15ade1122 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1,7 +1,7 @@
1/* Asynchronous subprocess control for GNU Emacs. 1/* Asynchronous subprocess control for GNU Emacs.
2 2
3Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2012 3Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2013 Free Software
4 Free Software Foundation, Inc. 4Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -180,10 +180,6 @@ static Lisp_Object Qlast_nonmenu_event;
180#define SERIALCONN_P(p) (EQ (XPROCESS (p)->type, Qserial)) 180#define SERIALCONN_P(p) (EQ (XPROCESS (p)->type, Qserial))
181#define SERIALCONN1_P(p) (EQ (p->type, Qserial)) 181#define SERIALCONN1_P(p) (EQ (p->type, Qserial))
182 182
183#ifndef HAVE_H_ERRNO
184extern int h_errno;
185#endif
186
187/* Number of events of change of status of a process. */ 183/* Number of events of change of status of a process. */
188static EMACS_INT process_tick; 184static EMACS_INT process_tick;
189/* Number of events for which the user or sentinel has been notified. */ 185/* Number of events for which the user or sentinel has been notified. */
@@ -4222,7 +4218,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4222 if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit) 4218 if (time_limit == 0 && nsecs == 0 && wait_proc && !NILP (Vinhibit_quit)
4223 && !(CONSP (wait_proc->status) 4219 && !(CONSP (wait_proc->status)
4224 && EQ (XCAR (wait_proc->status), Qexit))) 4220 && EQ (XCAR (wait_proc->status), Qexit)))
4225 message ("Blocking call to accept-process-output with quit inhibited!!"); 4221 message1 ("Blocking call to accept-process-output with quit inhibited!!");
4226 4222
4227 /* If wait_proc is a process to watch, set wait_channel accordingly. */ 4223 /* If wait_proc is a process to watch, set wait_channel accordingly. */
4228 if (wait_proc != NULL) 4224 if (wait_proc != NULL)
@@ -4773,11 +4769,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4773 Therefore, if we get an error reading and errno = 4769 Therefore, if we get an error reading and errno =
4774 EIO, just continue, because the child process has 4770 EIO, just continue, because the child process has
4775 exited and should clean itself up soon (e.g. when we 4771 exited and should clean itself up soon (e.g. when we
4776 get a SIGCHLD). 4772 get a SIGCHLD). */
4777
4778 However, it has been known to happen that the SIGCHLD
4779 got lost. So raise the signal again just in case.
4780 It can't hurt. */
4781 else if (nread == -1 && errno == EIO) 4773 else if (nread == -1 && errno == EIO)
4782 { 4774 {
4783 struct Lisp_Process *p = XPROCESS (proc); 4775 struct Lisp_Process *p = XPROCESS (proc);
@@ -4795,8 +4787,6 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4795 p->tick = ++process_tick; 4787 p->tick = ++process_tick;
4796 pset_status (p, Qfailed); 4788 pset_status (p, Qfailed);
4797 } 4789 }
4798 else
4799 handle_child_signal (SIGCHLD);
4800 } 4790 }
4801#endif /* HAVE_PTYS */ 4791#endif /* HAVE_PTYS */
4802 /* If we can detect process termination, don't consider the 4792 /* If we can detect process termination, don't consider the
@@ -5562,19 +5552,19 @@ it is sent in several bunches. This may happen even for shorter regions.
5562Output from processes can arrive in between bunches. */) 5552Output from processes can arrive in between bunches. */)
5563 (Lisp_Object process, Lisp_Object start, Lisp_Object end) 5553 (Lisp_Object process, Lisp_Object start, Lisp_Object end)
5564{ 5554{
5565 Lisp_Object proc; 5555 Lisp_Object proc = get_process (process);
5566 ptrdiff_t start1, end1; 5556 ptrdiff_t start_byte, end_byte;
5567 5557
5568 proc = get_process (process);
5569 validate_region (&start, &end); 5558 validate_region (&start, &end);
5570 5559
5560 start_byte = CHAR_TO_BYTE (XINT (start));
5561 end_byte = CHAR_TO_BYTE (XINT (end));
5562
5571 if (XINT (start) < GPT && XINT (end) > GPT) 5563 if (XINT (start) < GPT && XINT (end) > GPT)
5572 move_gap (XINT (start)); 5564 move_gap_both (XINT (start), start_byte);
5573 5565
5574 start1 = CHAR_TO_BYTE (XINT (start)); 5566 send_process (proc, (char *) BYTE_POS_ADDR (start_byte),
5575 end1 = CHAR_TO_BYTE (XINT (end)); 5567 end_byte - start_byte, Fcurrent_buffer ());
5576 send_process (proc, (char *) BYTE_POS_ADDR (start1), end1 - start1,
5577 Fcurrent_buffer ());
5578 5568
5579 return Qnil; 5569 return Qnil;
5580} 5570}