home *** CD-ROM | disk | FTP | other *** search
- From: jpn@teddy.UUCP (John P. Nelson)
- Newsgroups: comp.sources.misc
- Subject: Re: MicroGnu for MSDOS
- Message-ID: <4227@ncoast.UUCP>
- Date: 22 Aug 87 16:43:16 GMT
- Sender: allbery@ncoast.UUCP
- Organization: GenRad, Inc., Concord, Mass.
- Lines: 47
- Approved: allbery@ncoast.UUCP
- X-Archive: comp.sources.misc/8708/36
-
- My face is a bit red. My recent posting of MicroGnu for MSDOS was
- missing a file, spawn.c (actually sys/msdos/spawn.c). Here is spawn.c
- (not shar format)
-
- /*
- * Name: MicroEMACS spawn.c
- * Spawn CLI for MSDOS (MSC4.0)
- *
- */
- #include "def.h"
- #include <process.h>
-
- extern char *getenv();
-
- /*
- * On MSDOS, we got no job control like system V, so always
- * run a subshell. Bound to "C-C", and used
- * as a subcommand by "C-Z". (daveb)
- *
- * Returns 0 if the shell executed OK, something else if
- * we couldn't start shell or it exited badly.
- */
- spawncli(f, n, k)
- {
- char *comspec;
- int errp = FALSE;
-
- ttcolor(CTEXT);
- ttnowindow();
- ttmove(nrow-1, 0);
- if (epresf != FALSE) {
- tteeol();
- epresf = FALSE;
- }
- ttclose();
- sgarbf = TRUE; /* Force repaint. */
- if ((comspec = getenv("COMSPEC")) == NULL)
- errp = -1;
- else
- errp = spawnl(P_WAIT, comspec, "COMMAND.COM", (char *)NULL);
-
- ttopen();
- if(errp == -1)
- ewprintf("Failed to create process");
-
- return ( errp );
- }
-