diff options
| author | Eli Zaretskii | 2010-07-12 21:23:00 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-07-12 21:23:00 +0300 |
| commit | fc549af9e08b8c54c9632f69053affc95112bde0 (patch) | |
| tree | bc076195ecc90369a818492d2a201211c6383bfd /src/process.c | |
| parent | ded80a25b7d4a088dd4c4a714666705749106138 (diff) | |
| download | emacs-fc549af9e08b8c54c9632f69053affc95112bde0.tar.gz emacs-fc549af9e08b8c54c9632f69053affc95112bde0.zip | |
Fix the MS-DOS build (fallout from 2010-07-12T14:16:38Z!schwab@linux-m68k.org, 2010-07-12T17:04:38Z!dann@ics.uci.edu, 2010-07-12T17:21:11Z!dann@ics.uci.edu).
msdos/sed1v2.inp (C_WARNINGS_SWITCH, PROFILING_CFLAGS, PROFILING_LDFLAGS):
Edit to empty.
msdos/sed3v2.inp(C_WARNINGS_SWITCH, PROFILING_CFLAGS, PROFILING_LDFLAGS):
Edit to empty.
src/process.c (setup_process_coding_systems): Move to the part
shared by non-subprocesses systems, and make its body empty when
subprocesses is not defined.
(close_process_descs): Move to the part shared by non-subprocesses
systems.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 118 |
1 files changed, 61 insertions, 57 deletions
diff --git a/src/process.c b/src/process.c index 8de85354dd3..226326d9c5e 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -642,38 +642,6 @@ remove_process (register Lisp_Object proc) | |||
| 642 | deactivate_process (proc); | 642 | deactivate_process (proc); |
| 643 | } | 643 | } |
| 644 | 644 | ||
| 645 | /* Setup coding systems of PROCESS. */ | ||
| 646 | |||
| 647 | void | ||
| 648 | setup_process_coding_systems (Lisp_Object process) | ||
| 649 | { | ||
| 650 | struct Lisp_Process *p = XPROCESS (process); | ||
| 651 | int inch = p->infd; | ||
| 652 | int outch = p->outfd; | ||
| 653 | Lisp_Object coding_system; | ||
| 654 | |||
| 655 | if (inch < 0 || outch < 0) | ||
| 656 | return; | ||
| 657 | |||
| 658 | if (!proc_decode_coding_system[inch]) | ||
| 659 | proc_decode_coding_system[inch] | ||
| 660 | = (struct coding_system *) xmalloc (sizeof (struct coding_system)); | ||
| 661 | coding_system = p->decode_coding_system; | ||
| 662 | if (! NILP (p->filter)) | ||
| 663 | ; | ||
| 664 | else if (BUFFERP (p->buffer)) | ||
| 665 | { | ||
| 666 | if (NILP (XBUFFER (p->buffer)->enable_multibyte_characters)) | ||
| 667 | coding_system = raw_text_coding_system (coding_system); | ||
| 668 | } | ||
| 669 | setup_coding_system (coding_system, proc_decode_coding_system[inch]); | ||
| 670 | |||
| 671 | if (!proc_encode_coding_system[outch]) | ||
| 672 | proc_encode_coding_system[outch] | ||
| 673 | = (struct coding_system *) xmalloc (sizeof (struct coding_system)); | ||
| 674 | setup_coding_system (p->encode_coding_system, | ||
| 675 | proc_encode_coding_system[outch]); | ||
| 676 | } | ||
| 677 | 645 | ||
| 678 | DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0, | 646 | DEFUN ("processp", Fprocessp, Sprocessp, 1, 1, 0, |
| 679 | doc: /* Return t if OBJECT is a process. */) | 647 | doc: /* Return t if OBJECT is a process. */) |
| @@ -4113,31 +4081,6 @@ deactivate_process (Lisp_Object proc) | |||
| 4113 | } | 4081 | } |
| 4114 | } | 4082 | } |
| 4115 | 4083 | ||
| 4116 | /* Close all descriptors currently in use for communication | ||
| 4117 | with subprocess. This is used in a newly-forked subprocess | ||
| 4118 | to get rid of irrelevant descriptors. */ | ||
| 4119 | |||
| 4120 | void | ||
| 4121 | close_process_descs (void) | ||
| 4122 | { | ||
| 4123 | #ifndef DOS_NT | ||
| 4124 | int i; | ||
| 4125 | for (i = 0; i < MAXDESC; i++) | ||
| 4126 | { | ||
| 4127 | Lisp_Object process; | ||
| 4128 | process = chan_process[i]; | ||
| 4129 | if (!NILP (process)) | ||
| 4130 | { | ||
| 4131 | int in = XPROCESS (process)->infd; | ||
| 4132 | int out = XPROCESS (process)->outfd; | ||
| 4133 | if (in >= 0) | ||
| 4134 | emacs_close (in); | ||
| 4135 | if (out >= 0 && in != out) | ||
| 4136 | emacs_close (out); | ||
| 4137 | } | ||
| 4138 | } | ||
| 4139 | #endif | ||
| 4140 | } | ||
| 4141 | 4084 | ||
| 4142 | DEFUN ("accept-process-output", Faccept_process_output, Saccept_process_output, | 4085 | DEFUN ("accept-process-output", Faccept_process_output, Saccept_process_output, |
| 4143 | 0, 4, 0, | 4086 | 0, 4, 0, |
| @@ -7208,6 +7151,67 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 7208 | /* The following functions are needed even if async subprocesses are | 7151 | /* The following functions are needed even if async subprocesses are |
| 7209 | not supported. Some of them are no-op stubs in that case. */ | 7152 | not supported. Some of them are no-op stubs in that case. */ |
| 7210 | 7153 | ||
| 7154 | /* Setup coding systems of PROCESS. */ | ||
| 7155 | |||
| 7156 | void | ||
| 7157 | setup_process_coding_systems (Lisp_Object process) | ||
| 7158 | { | ||
| 7159 | #ifdef subprocesses | ||
| 7160 | struct Lisp_Process *p = XPROCESS (process); | ||
| 7161 | int inch = p->infd; | ||
| 7162 | int outch = p->outfd; | ||
| 7163 | Lisp_Object coding_system; | ||
| 7164 | |||
| 7165 | if (inch < 0 || outch < 0) | ||
| 7166 | return; | ||
| 7167 | |||
| 7168 | if (!proc_decode_coding_system[inch]) | ||
| 7169 | proc_decode_coding_system[inch] | ||
| 7170 | = (struct coding_system *) xmalloc (sizeof (struct coding_system)); | ||
| 7171 | coding_system = p->decode_coding_system; | ||
| 7172 | if (! NILP (p->filter)) | ||
| 7173 | ; | ||
| 7174 | else if (BUFFERP (p->buffer)) | ||
| 7175 | { | ||
| 7176 | if (NILP (XBUFFER (p->buffer)->enable_multibyte_characters)) | ||
| 7177 | coding_system = raw_text_coding_system (coding_system); | ||
| 7178 | } | ||
| 7179 | setup_coding_system (coding_system, proc_decode_coding_system[inch]); | ||
| 7180 | |||
| 7181 | if (!proc_encode_coding_system[outch]) | ||
| 7182 | proc_encode_coding_system[outch] | ||
| 7183 | = (struct coding_system *) xmalloc (sizeof (struct coding_system)); | ||
| 7184 | setup_coding_system (p->encode_coding_system, | ||
| 7185 | proc_encode_coding_system[outch]); | ||
| 7186 | #endif | ||
| 7187 | } | ||
| 7188 | |||
| 7189 | /* Close all descriptors currently in use for communication | ||
| 7190 | with subprocess. This is used in a newly-forked subprocess | ||
| 7191 | to get rid of irrelevant descriptors. */ | ||
| 7192 | |||
| 7193 | void | ||
| 7194 | close_process_descs (void) | ||
| 7195 | { | ||
| 7196 | #ifndef DOS_NT | ||
| 7197 | int i; | ||
| 7198 | for (i = 0; i < MAXDESC; i++) | ||
| 7199 | { | ||
| 7200 | Lisp_Object process; | ||
| 7201 | process = chan_process[i]; | ||
| 7202 | if (!NILP (process)) | ||
| 7203 | { | ||
| 7204 | int in = XPROCESS (process)->infd; | ||
| 7205 | int out = XPROCESS (process)->outfd; | ||
| 7206 | if (in >= 0) | ||
| 7207 | emacs_close (in); | ||
| 7208 | if (out >= 0 && in != out) | ||
| 7209 | emacs_close (out); | ||
| 7210 | } | ||
| 7211 | } | ||
| 7212 | #endif | ||
| 7213 | } | ||
| 7214 | |||
| 7211 | DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0, | 7215 | DEFUN ("get-buffer-process", Fget_buffer_process, Sget_buffer_process, 1, 1, 0, |
| 7212 | doc: /* Return the (or a) process associated with BUFFER. | 7216 | doc: /* Return the (or a) process associated with BUFFER. |
| 7213 | BUFFER may be a buffer or the name of one. */) | 7217 | BUFFER may be a buffer or the name of one. */) |