comparison src/process-nt.c @ 380:8626e4521993 r21-2-5

Import from CVS: tag r21-2-5
author cvs
date Mon, 13 Aug 2007 11:07:10 +0200
parents 6240c7796c7a
children c6012109f545
comparison
equal deleted inserted replaced
379:76b7d63099ad 380:8626e4521993
1 /* Asynchronous subprocess implemenation for Win32 1 /* Asynchronous subprocess implementation for Win32
2 Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995 2 Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 Copyright (C) 1995 Sun Microsystems, Inc. 4 Copyright (C) 1995 Sun Microsystems, Inc.
5 Copyright (C) 1995, 1996 Ben Wing. 5 Copyright (C) 1995, 1996 Ben Wing.
6 6
43 #define FRAGMENT_CODE_SIZE 32 43 #define FRAGMENT_CODE_SIZE 32
44 44
45 /* Bound by winnt.el */ 45 /* Bound by winnt.el */
46 Lisp_Object Qnt_quote_process_args; 46 Lisp_Object Qnt_quote_process_args;
47 47
48 /* Implemenation-specific data. Pointed to by Lisp_Process->process_data */ 48 /* Implementation-specific data. Pointed to by Lisp_Process->process_data */
49 struct nt_process_data 49 struct nt_process_data
50 { 50 {
51 HANDLE h_process; 51 HANDLE h_process;
52 }; 52 };
53 53
380 if (NT_DATA(p)->h_process) 380 if (NT_DATA(p)->h_process)
381 CloseHandle (NT_DATA(p)->h_process); 381 CloseHandle (NT_DATA(p)->h_process);
382 } 382 }
383 383
384 /* 384 /*
385 * Initialize XEmacs process implemenation once 385 * Initialize XEmacs process implementation once
386 */ 386 */
387 static void 387 static void
388 nt_init_process (void) 388 nt_init_process (void)
389 { 389 {
390 /* Initialize winsock */ 390 /* Initialize winsock */
396 /* 396 /*
397 * Fork off a subprocess. P is a pointer to newly created subprocess 397 * Fork off a subprocess. P is a pointer to newly created subprocess
398 * object. If this function signals, the caller is responsible for 398 * object. If this function signals, the caller is responsible for
399 * deleting (and finalizing) the process object. 399 * deleting (and finalizing) the process object.
400 * 400 *
401 * The method must return PID of the new proces, a (positive??? ####) number 401 * The method must return PID of the new process, a (positive??? ####) number
402 * which fits into Lisp_Int. No return value indicates an error, the method 402 * which fits into Lisp_Int. No return value indicates an error, the method
403 * must signal an error instead. 403 * must signal an error instead.
404 */ 404 */
405 405
406 /* #### This function completely ignores Vprocess_environment */ 406 /* #### This function completely ignores Vprocess_environment */
605 } 605 }
606 } 606 }
607 } 607 }
608 608
609 /* 609 /*
610 * Stuff the entire contents of LSTREAM to the process ouptut pipe 610 * Stuff the entire contents of LSTREAM to the process output pipe
611 */ 611 */
612 612
613 /* #### If only this function could be somehow merged with 613 /* #### If only this function could be somehow merged with
614 unix_send_process... */ 614 unix_send_process... */
615 615
891 FD_SET (s, &fdset); 891 FD_SET (s, &fdset);
892 nsel = select (0, NULL, &fdset, &fdset, &tv); 892 nsel = select (0, NULL, &fdset, &fdset, &tv);
893 893
894 if (nsel > 0) 894 if (nsel > 0)
895 { 895 {
896 /* Check was connnection successful or not */ 896 /* Check: was connection successful or not? */
897 tv.tv_usec = 0; 897 tv.tv_usec = 0;
898 nsel = select (0, NULL, NULL, &fdset, &tv); 898 nsel = select (0, NULL, NULL, &fdset, &tv);
899 if (nsel > 0) 899 if (nsel > 0)
900 goto connect_failed; 900 goto connect_failed;
901 else 901 else