comparison src/callproc.c @ 638:40b255f55df3

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Sun, 10 May 1992 18:15:10 +0000
parents 2bb7f23b7ea5
children 70b112526394
comparison
equal deleted inserted replaced
637:639afe138172 638:40b255f55df3
193 { 193 {
194 /* child_setup must clobber environ in systems with true vfork. 194 /* child_setup must clobber environ in systems with true vfork.
195 Protect it from permanent change. */ 195 Protect it from permanent change. */
196 register char **save_environ = environ; 196 register char **save_environ = environ;
197 register int fd1 = fd[1]; 197 register int fd1 = fd[1];
198 char **env;
199
200 env = environ;
201 198
202 #if 0 /* Some systems don't have sigblock. */ 199 #if 0 /* Some systems don't have sigblock. */
203 EMACS_SIGBLOCK (sigmask (SIGCHLD), mask); 200 mask = sigblock (sigmask (SIGCHLD));
204 #endif 201 #endif
205 202
206 /* Record that we're about to create a synchronous process. */ 203 /* Record that we're about to create a synchronous process. */
207 synch_process_alive = 1; 204 synch_process_alive = 1;
208 205
215 #ifdef USG 212 #ifdef USG
216 setpgrp (); 213 setpgrp ();
217 #else 214 #else
218 setpgrp (pid, pid); 215 setpgrp (pid, pid);
219 #endif /* USG */ 216 #endif /* USG */
220 child_setup (filefd, fd1, fd1, new_argv, env, 0, current_dir); 217 child_setup (filefd, fd1, fd1, new_argv, 0, current_dir);
221 } 218 }
222 219
223 #if 0 220 #if 0
224 /* Tell SIGCHLD handler to look for this pid. */ 221 /* Tell SIGCHLD handler to look for this pid. */
225 synch_process_pid = pid; 222 synch_process_pid = pid;
226 /* Now let SIGCHLD come through. */ 223 /* Now let SIGCHLD come through. */
227 { 224 sigsetmask (mask);
228 int dummy;
229
230 EMACS_SIGSETMASK (mask, dummy);
231 }
232 #endif 225 #endif
233 226
234 environ = save_environ; 227 environ = save_environ;
235 228
236 close (filefd); 229 close (filefd);
366 CURRENT_DIR is an elisp string giving the path of the current 359 CURRENT_DIR is an elisp string giving the path of the current
367 directory the subprocess should have. Since we can't really signal 360 directory the subprocess should have. Since we can't really signal
368 a decent error from within the child, this should be verified as an 361 a decent error from within the child, this should be verified as an
369 executable directory by the parent. */ 362 executable directory by the parent. */
370 363
371 child_setup (in, out, err, new_argv, env, set_pgrp, current_dir) 364 child_setup (in, out, err, new_argv, set_pgrp, current_dir)
372 int in, out, err; 365 int in, out, err;
373 register char **new_argv; 366 register char **new_argv;
374 char **env;
375 int set_pgrp; 367 int set_pgrp;
376 Lisp_Object current_dir; 368 Lisp_Object current_dir;
377 { 369 {
370 char **env;
371
378 register int pid = getpid(); 372 register int pid = getpid();
379 373
380 setpriority (PRIO_PROCESS, pid, 0); 374 setpriority (PRIO_PROCESS, pid, 0);
381 375
382 #ifdef subprocesses 376 #ifdef subprocesses
422 new_length++; 416 new_length++;
423 417
424 /* new_length + 1 to include terminating 0 */ 418 /* new_length + 1 to include terminating 0 */
425 env = new_env = (char **) alloca ((new_length + 1) * sizeof (char *)); 419 env = new_env = (char **) alloca ((new_length + 1) * sizeof (char *));
426 420
427 /* Copy the env strings into new_env. */ 421 /* Copy the Vprocess_alist strings into new_env. */
428 for (tem = Vprocess_environment; 422 for (tem = Vprocess_environment;
429 (XTYPE (tem) == Lisp_Cons 423 (XTYPE (tem) == Lisp_Cons
430 && XTYPE (XCONS (tem)->car) == Lisp_String); 424 && XTYPE (XCONS (tem)->car) == Lisp_String);
431 tem = XCONS (tem)->cdr) 425 tem = XCONS (tem)->cdr)
432 *new_env++ = (char *) XSTRING (XCONS (tem)->car)->data; 426 *new_env++ = (char *) XSTRING (XCONS (tem)->car)->data;