diff options
| author | Gerd Moellmann | 2001-03-07 12:55:29 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-07 12:55:29 +0000 |
| commit | 471f86b9a3d57ba805f14e21fbc8d462c6802df5 (patch) | |
| tree | 3bd2b3b0961bf7555990e40b0bbdc2c17626263c /src/process.c | |
| parent | 2ad02767327ec06cf09fe6df991d425183797387 (diff) | |
| download | emacs-471f86b9a3d57ba805f14e21fbc8d462c6802df5.tar.gz emacs-471f86b9a3d57ba805f14e21fbc8d462c6802df5.zip | |
(Fset_process_filter): Don't crash if the input
file descriptor of PROCESS is closed.
(Fset_process_window_size): Likewise.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/src/process.c b/src/process.c index b41478c0bd3..f1541800004 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -734,18 +734,34 @@ If the process has a filter, its buffer is not used for output.") | |||
| 734 | (process, filter) | 734 | (process, filter) |
| 735 | register Lisp_Object process, filter; | 735 | register Lisp_Object process, filter; |
| 736 | { | 736 | { |
| 737 | struct Lisp_Process *p; | ||
| 738 | |||
| 737 | CHECK_PROCESS (process, 0); | 739 | CHECK_PROCESS (process, 0); |
| 738 | if (EQ (filter, Qt)) | 740 | p = XPROCESS (process); |
| 739 | { | 741 | |
| 740 | FD_CLR (XINT (XPROCESS (process)->infd), &input_wait_mask); | 742 | /* Don't signal an error if the process' input file descriptor |
| 741 | FD_CLR (XINT (XPROCESS (process)->infd), &non_keyboard_wait_mask); | 743 | is closed. This could make debugging Lisp more difficult, |
| 742 | } | 744 | for example when doing something like |
| 743 | else if (EQ (XPROCESS (process)->filter, Qt)) | 745 | |
| 746 | (setq process (start-process ...)) | ||
| 747 | (debug) | ||
| 748 | (set-process-filter process ...) */ | ||
| 749 | |||
| 750 | if (XINT (p->infd) >= 0) | ||
| 744 | { | 751 | { |
| 745 | FD_SET (XINT (XPROCESS (process)->infd), &input_wait_mask); | 752 | if (EQ (filter, Qt)) |
| 746 | FD_SET (XINT (XPROCESS (process)->infd), &non_keyboard_wait_mask); | 753 | { |
| 754 | FD_CLR (XINT (p->infd), &input_wait_mask); | ||
| 755 | FD_CLR (XINT (p->infd), &non_keyboard_wait_mask); | ||
| 756 | } | ||
| 757 | else if (EQ (XPROCESS (process)->filter, Qt)) | ||
| 758 | { | ||
| 759 | FD_SET (XINT (p->infd), &input_wait_mask); | ||
| 760 | FD_SET (XINT (p->infd), &non_keyboard_wait_mask); | ||
| 761 | } | ||
| 747 | } | 762 | } |
| 748 | XPROCESS (process)->filter = filter; | 763 | |
| 764 | p->filter = filter; | ||
| 749 | return filter; | 765 | return filter; |
| 750 | } | 766 | } |
| 751 | 767 | ||
| @@ -793,8 +809,10 @@ DEFUN ("set-process-window-size", Fset_process_window_size, | |||
| 793 | CHECK_PROCESS (process, 0); | 809 | CHECK_PROCESS (process, 0); |
| 794 | CHECK_NATNUM (height, 0); | 810 | CHECK_NATNUM (height, 0); |
| 795 | CHECK_NATNUM (width, 0); | 811 | CHECK_NATNUM (width, 0); |
| 796 | if (set_window_size (XINT (XPROCESS (process)->infd), | 812 | |
| 797 | XINT (height), XINT (width)) <= 0) | 813 | if (XINT (XPROCESS (process)->infd < 0) |
| 814 | || set_window_size (XINT (XPROCESS (process)->infd), | ||
| 815 | XINT (height), XINT (width)) <= 0) | ||
| 798 | return Qnil; | 816 | return Qnil; |
| 799 | else | 817 | else |
| 800 | return Qt; | 818 | return Qt; |