comparison src/event-unixoid.c @ 282:c42ec1d1cded r21-0b39

Import from CVS: tag r21-0b39
author cvs
date Mon, 13 Aug 2007 10:33:18 +0200
parents 90d73dddcdc4
children 6719134a07c2
comparison
equal deleted inserted replaced
281:090b52736db2 282:c42ec1d1cded
255 int flags) 255 int flags)
256 { 256 {
257 int infd, outfd; 257 int infd, outfd;
258 /* Decode inhandle and outhandle. Their meaning depends on 258 /* Decode inhandle and outhandle. Their meaning depends on
259 the process implementation being used. */ 259 the process implementation being used. */
260 #ifdef HAVE_WIN32_PROCESSES 260 #if defined (HAVE_WIN32_PROCESSES)
261 /* We're passed in Windows handles. Open new fds for them */ 261 /* We're passed in Windows handles. Open new fds for them */
262 if ((HANDLE)inhandle != INVALID_HANDLE_VALUE) 262 if ((HANDLE)inhandle != INVALID_HANDLE_VALUE)
263 { 263 {
264 infd = open_osfhandle ((HANDLE)inhandle, 0); 264 infd = open_osfhandle ((HANDLE)inhandle, 0);
265 if (infd < 0) 265 if (infd < 0)
280 } 280 }
281 else 281 else
282 outfd = -1; 282 outfd = -1;
283 283
284 flags = 0; 284 flags = 0;
285 #endif 285 #elif defined (HAVE_UNIX_PROCESSES)
286
287 #ifdef HAVE_UNIX_PROCESSES
288 /* We are passed plain old file descs */ 286 /* We are passed plain old file descs */
289 infd = (int)inhandle; 287 infd = (int)inhandle;
290 outfd = (int)outhandle; 288 outfd = (int)outhandle;
289 #else
290 # error Which processes do you have?
291 #endif 291 #endif
292 292
293 *instream = (infd >= 0 293 *instream = (infd >= 0
294 ? make_filedesc_input_stream (infd, 0, -1, 0) 294 ? make_filedesc_input_stream (infd, 0, -1, 0)
295 : Qnil); 295 : Qnil);
298 ? make_filedesc_output_stream (outfd, 0, -1, LSTR_BLOCKED_OK) 298 ? make_filedesc_output_stream (outfd, 0, -1, LSTR_BLOCKED_OK)
299 : Qnil); 299 : Qnil);
300 300
301 #if defined(HAVE_UNIX_PROCESSES) && defined(HAVE_PTYS) 301 #if defined(HAVE_UNIX_PROCESSES) && defined(HAVE_PTYS)
302 /* FLAGS is process->pty_flag for UNIX_PROCESSES */ 302 /* FLAGS is process->pty_flag for UNIX_PROCESSES */
303 if (flags && outfd >= 0) 303 if ((flags & STREAM_PTY_FLUSHING) && outfd >= 0)
304 { 304 {
305 Bufbyte eof_char = get_eof_char (outfd); 305 Bufbyte eof_char = get_eof_char (outfd);
306 int pty_max_bytes = get_pty_max_bytes (outfd); 306 int pty_max_bytes = get_pty_max_bytes (outfd);
307 filedesc_stream_set_pty_flushing (XLSTREAM(*outstream), pty_max_bytes, eof_char); 307 filedesc_stream_set_pty_flushing (XLSTREAM(*outstream), pty_max_bytes, eof_char);
308 } 308 }