Mercurial > emacs
comparison src/process.c @ 15092:5372670fbe59
(Fopen_network_stream): Set process infd to inch.
(create_process, read_process_output, Fsignal_process) [WINDOWSNT]:
Remove conditional NT code.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 26 Apr 1996 19:55:27 +0000 |
parents | fb0f2804c34a |
children | 6bb377ef707f |
comparison
equal
deleted
inserted
replaced
15091:e05dd165b889 | 15092:5372670fbe59 |
---|---|
1253 outchannel = inchannel = sv[0]; | 1253 outchannel = inchannel = sv[0]; |
1254 forkout = forkin = sv[1]; | 1254 forkout = forkin = sv[1]; |
1255 } | 1255 } |
1256 #else /* not SKTPAIR */ | 1256 #else /* not SKTPAIR */ |
1257 { | 1257 { |
1258 #ifdef WINDOWSNT | |
1259 pipe_with_inherited_out (sv); | |
1260 inchannel = sv[0]; | |
1261 forkout = sv[1]; | |
1262 | |
1263 pipe_with_inherited_in (sv); | |
1264 forkin = sv[0]; | |
1265 outchannel = sv[1]; | |
1266 #else /* not WINDOWSNT */ | |
1267 pipe (sv); | 1258 pipe (sv); |
1268 inchannel = sv[0]; | 1259 inchannel = sv[0]; |
1269 forkout = sv[1]; | 1260 forkout = sv[1]; |
1270 pipe (sv); | 1261 pipe (sv); |
1271 outchannel = sv[1]; | 1262 outchannel = sv[1]; |
1272 forkin = sv[0]; | 1263 forkin = sv[0]; |
1273 #endif /* not WINDOWSNT */ | |
1274 } | 1264 } |
1275 #endif /* not SKTPAIR */ | 1265 #endif /* not SKTPAIR */ |
1276 | 1266 |
1277 #if 0 | 1267 #if 0 |
1278 /* Replaced by close_process_descs */ | 1268 /* Replaced by close_process_descs */ |
1798 XPROCESS (proc)->buffer = buffer; | 1788 XPROCESS (proc)->buffer = buffer; |
1799 XPROCESS (proc)->sentinel = Qnil; | 1789 XPROCESS (proc)->sentinel = Qnil; |
1800 XPROCESS (proc)->filter = Qnil; | 1790 XPROCESS (proc)->filter = Qnil; |
1801 XPROCESS (proc)->command = Qnil; | 1791 XPROCESS (proc)->command = Qnil; |
1802 XPROCESS (proc)->pid = Qnil; | 1792 XPROCESS (proc)->pid = Qnil; |
1803 XSETINT (XPROCESS (proc)->infd, s); | 1793 XSETINT (XPROCESS (proc)->infd, inch); |
1804 XSETINT (XPROCESS (proc)->outfd, outch); | 1794 XSETINT (XPROCESS (proc)->outfd, outch); |
1805 XPROCESS (proc)->status = Qrun; | 1795 XPROCESS (proc)->status = Qrun; |
1806 FD_SET (inch, &input_wait_mask); | 1796 FD_SET (inch, &input_wait_mask); |
1807 FD_SET (inch, &non_keyboard_wait_mask); | 1797 FD_SET (inch, &non_keyboard_wait_mask); |
1808 if (inch > max_process_desc) | 1798 if (inch > max_process_desc) |
2461 return 1; /* Nothing worth printing, say we got 1 */ | 2451 return 1; /* Nothing worth printing, say we got 1 */ |
2462 } | 2452 } |
2463 #else /* not VMS */ | 2453 #else /* not VMS */ |
2464 | 2454 |
2465 if (proc_buffered_char[channel] < 0) | 2455 if (proc_buffered_char[channel] < 0) |
2466 #ifdef WINDOWSNT | 2456 nchars = read (channel, chars, sizeof (chars)); |
2467 nchars = read_child_output (channel, chars, sizeof (chars)); | |
2468 #else | |
2469 nchars = read (channel, chars, sizeof chars); | |
2470 #endif | |
2471 else | 2457 else |
2472 { | 2458 { |
2473 chars[0] = proc_buffered_char[channel]; | 2459 chars[0] = proc_buffered_char[channel]; |
2474 proc_buffered_char[channel] = -1; | 2460 proc_buffered_char[channel] = -1; |
2475 #ifdef WINDOWSNT | 2461 nchars = read (channel, chars + 1, sizeof (chars) - 1); |
2476 nchars = read_child_output (channel, chars + 1, sizeof (chars) - 1); | |
2477 #else | |
2478 nchars = read (channel, chars + 1, sizeof chars - 1); | |
2479 #endif | |
2480 if (nchars < 0) | 2462 if (nchars < 0) |
2481 nchars = 1; | 2463 nchars = 1; |
2482 else | 2464 else |
2483 nchars = nchars + 1; | 2465 nchars = nchars + 1; |
2484 } | 2466 } |
3226 error ("Undefined signal name %s", name); | 3208 error ("Undefined signal name %s", name); |
3227 } | 3209 } |
3228 | 3210 |
3229 #undef handle_signal | 3211 #undef handle_signal |
3230 | 3212 |
3231 #ifdef WINDOWSNT | |
3232 /* Only works for kill-type signals */ | |
3233 return make_number (win32_kill_process (XINT (pid), XINT (sigcode))); | |
3234 #else | |
3235 return make_number (kill (XINT (pid), XINT (sigcode))); | 3213 return make_number (kill (XINT (pid), XINT (sigcode))); |
3236 #endif | |
3237 } | 3214 } |
3238 | 3215 |
3239 DEFUN ("process-send-eof", Fprocess_send_eof, Sprocess_send_eof, 0, 1, 0, | 3216 DEFUN ("process-send-eof", Fprocess_send_eof, Sprocess_send_eof, 0, 1, 0, |
3240 "Make PROCESS see end-of-file in its input.\n\ | 3217 "Make PROCESS see end-of-file in its input.\n\ |
3241 Eof comes after any text already sent to it.\n\ | 3218 Eof comes after any text already sent to it.\n\ |