diff options
| author | Stefan Monnier | 2010-04-12 22:07:48 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2010-04-12 22:07:48 -0400 |
| commit | 2b0a91e78f83fb446cc38efb99399e83ad2cded3 (patch) | |
| tree | 7f387f7fe5cba2a8889e8a4de9ec22686ff29c22 /src/process.c | |
| parent | 58b963f7f3d9d8e869408666608c05f3c69a5cb5 (diff) | |
| download | emacs-2b0a91e78f83fb446cc38efb99399e83ad2cded3.tar.gz emacs-2b0a91e78f83fb446cc38efb99399e83ad2cded3.zip | |
Try to solve the problem of spurious EOF chars in long lines of text
sent to interactive subprocesses.
* sysdep.c (child_setup_tty): Do not enable ICANON any more.
(system_process_attributes): Remove unused var `ttotal'.
* process.c (send_process): Don't bother breaking long line with EOF
chars when talking to ttys any more.
(wait_reading_process_output): Output a warning when called in such
a way that it could block without being interruptible.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/src/process.c b/src/process.c index 34aa2c4fcff..7e8f4cc57bc 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4643,6 +4643,10 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4643 | FD_ZERO (&Connecting); | 4643 | FD_ZERO (&Connecting); |
| 4644 | #endif | 4644 | #endif |
| 4645 | 4645 | ||
| 4646 | if (time_limit == 0 && wait_proc && !NILP (Vinhibit_quit) | ||
| 4647 | && !(CONSP (wait_proc->status) && EQ (XCAR (wait_proc->status), Qexit))) | ||
| 4648 | message ("Blocking call to accept-process-output with quit inhibited!!"); | ||
| 4649 | |||
| 4646 | /* If wait_proc is a process to watch, set wait_channel accordingly. */ | 4650 | /* If wait_proc is a process to watch, set wait_channel accordingly. */ |
| 4647 | if (wait_proc != NULL) | 4651 | if (wait_proc != NULL) |
| 4648 | wait_channel = wait_proc->infd; | 4652 | wait_channel = wait_proc->infd; |
| @@ -5768,34 +5772,6 @@ send_process (proc, buf, len, object) | |||
| 5768 | { | 5772 | { |
| 5769 | int this = len; | 5773 | int this = len; |
| 5770 | 5774 | ||
| 5771 | /* Decide how much data we can send in one batch. | ||
| 5772 | Long lines need to be split into multiple batches. */ | ||
| 5773 | if (p->pty_flag) | ||
| 5774 | { | ||
| 5775 | /* Starting this at zero is always correct when not the first | ||
| 5776 | iteration because the previous iteration ended by sending C-d. | ||
| 5777 | It may not be correct for the first iteration | ||
| 5778 | if a partial line was sent in a separate send_process call. | ||
| 5779 | If that proves worth handling, we need to save linepos | ||
| 5780 | in the process object. */ | ||
| 5781 | int linepos = 0; | ||
| 5782 | unsigned char *ptr = (unsigned char *) buf; | ||
| 5783 | unsigned char *end = (unsigned char *) buf + len; | ||
| 5784 | |||
| 5785 | /* Scan through this text for a line that is too long. */ | ||
| 5786 | while (ptr != end && linepos < pty_max_bytes) | ||
| 5787 | { | ||
| 5788 | if (*ptr == '\n') | ||
| 5789 | linepos = 0; | ||
| 5790 | else | ||
| 5791 | linepos++; | ||
| 5792 | ptr++; | ||
| 5793 | } | ||
| 5794 | /* If we found one, break the line there | ||
| 5795 | and put in a C-d to force the buffer through. */ | ||
| 5796 | this = ptr - buf; | ||
| 5797 | } | ||
| 5798 | |||
| 5799 | /* Send this batch, using one or more write calls. */ | 5775 | /* Send this batch, using one or more write calls. */ |
| 5800 | while (this > 0) | 5776 | while (this > 0) |
| 5801 | { | 5777 | { |
| @@ -5899,11 +5875,6 @@ send_process (proc, buf, len, object) | |||
| 5899 | len -= rv; | 5875 | len -= rv; |
| 5900 | this -= rv; | 5876 | this -= rv; |
| 5901 | } | 5877 | } |
| 5902 | |||
| 5903 | /* If we sent just part of the string, put in an EOF (C-d) | ||
| 5904 | to force it through, before we send the rest. */ | ||
| 5905 | if (len > 0) | ||
| 5906 | Fprocess_send_eof (proc); | ||
| 5907 | } | 5878 | } |
| 5908 | } | 5879 | } |
| 5909 | else | 5880 | else |