Mercurial > emacs
comparison src/msdos.c @ 13718:e1b33f87545f
(run_msdos_command): Support redirection of stderr.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 13 Dec 1995 02:26:07 +0000 |
parents | d7bb4093a950 |
children | 120c884de8a2 |
comparison
equal
deleted
inserted
replaced
13717:d7bb4093a950 | 13718:e1b33f87545f |
---|---|
2194 return !outregs.x.cflag; | 2194 return !outregs.x.cflag; |
2195 } | 2195 } |
2196 | 2196 |
2197 | 2197 |
2198 /* Run command as specified by ARGV in directory DIR. | 2198 /* Run command as specified by ARGV in directory DIR. |
2199 The command is run with input from TEMPIN and output to file TEMPOUT. */ | 2199 The command is run with input from TEMPIN, output to |
2200 file TEMPOUT and stderr to TEMPERR. */ | |
2200 int | 2201 int |
2201 run_msdos_command (argv, dir, tempin, tempout) | 2202 run_msdos_command (argv, dir, tempin, tempout, temperr) |
2202 unsigned char **argv; | 2203 unsigned char **argv; |
2203 Lisp_Object dir; | 2204 Lisp_Object dir; |
2204 int tempin, tempout; | 2205 int tempin, tempout, temperr; |
2205 { | 2206 { |
2206 char *saveargv1, *saveargv2, **envv; | 2207 char *saveargv1, *saveargv2, **envv; |
2207 char oldwd[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ | 2208 char oldwd[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ |
2208 int msshell, result = -1; | 2209 int msshell, result = -1; |
2209 int in, out, inbak, outbak, errbak; | 2210 int in, out, inbak, outbak, errbak; |
2270 | 2271 |
2271 dos_ttcooked (); /* do it here while 0 = stdin */ | 2272 dos_ttcooked (); /* do it here while 0 = stdin */ |
2272 | 2273 |
2273 dup2 (tempin, 0); | 2274 dup2 (tempin, 0); |
2274 dup2 (tempout, 1); | 2275 dup2 (tempout, 1); |
2275 dup2 (tempout, 2); | 2276 dup2 (temperr, 2); |
2276 | 2277 |
2277 result = spawnve (P_WAIT, argv[0], argv, envv); | 2278 result = spawnve (P_WAIT, argv[0], argv, envv); |
2278 | 2279 |
2279 dup2 (inbak, 0); | 2280 dup2 (inbak, 0); |
2280 dup2 (outbak, 1); | 2281 dup2 (outbak, 1); |