comparison src/process-unix.c @ 288:e11d67e05968 r21-0b42

Import from CVS: tag r21-0b42
author cvs
date Mon, 13 Aug 2007 10:35:54 +0200
parents 558f606b08ae
children 70ad99077275
comparison
equal deleted inserted replaced
287:13a0bd77a29d 288:e11d67e05968
713 * must signal an error instead. 713 * must signal an error instead.
714 */ 714 */
715 715
716 static int 716 static int
717 unix_create_process (struct Lisp_Process *p, 717 unix_create_process (struct Lisp_Process *p,
718 char **new_argv, CONST char *current_dir) 718 Lisp_Object *argv, int nargv,
719 Lisp_Object program, Lisp_Object cur_dir)
719 { 720 {
720 /* This function rewritten by wing@666.com. */ 721 /* This function rewritten by wing@666.com. */
721 722
722 int pid, inchannel, outchannel; 723 int pid, inchannel, outchannel;
723 /* Use volatile to protect variables from being clobbered by longjmp. */ 724 /* Use volatile to protect variables from being clobbered by longjmp. */
724 volatile int forkin, forkout; 725 volatile int forkin, forkout;
725 volatile int pty_flag = 0; 726 volatile int pty_flag = 0;
726 char **env; 727 char **env;
728 char **new_argv;
729 char *current_dir;
730 int i;
727 731
728 env = environ; 732 env = environ;
729 733
730 inchannel = outchannel = forkin = forkout = -1; 734 inchannel = outchannel = forkin = forkout = -1;
735
736 /* Nothing below here GCs so our string pointers shouldn't move. */
737 new_argv = alloca_array (char *, nargv + 2);
738 new_argv[0] = (char *) XSTRING_DATA (program);
739 for (i = 0; i < nargv; i++)
740 {
741 Lisp_Object tem = argv[i];
742 CHECK_STRING (tem);
743 new_argv[i + 1] = (char *) XSTRING_DATA (tem);
744 }
745 new_argv[i + 1] = 0;
746 current_dir = (char *) XSTRING_DATA (cur_dir);
731 747
732 #ifdef HAVE_PTYS 748 #ifdef HAVE_PTYS
733 if (!NILP (Vprocess_connection_type)) 749 if (!NILP (Vprocess_connection_type))
734 { 750 {
735 /* find a new pty, open the master side, return the opened 751 /* find a new pty, open the master side, return the opened