aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-23 00:23:36 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-23 04:44:45 +1000
commite0ef52d2fabdb4772aaa87a417d841fe58d04e0d (patch)
tree76bf9c623654a054aa3b3969cfd0013328cc3c54 /shell
parent6f49b7d9d41833dcadda1faeb27b31bc49e66b0f (diff)
downloadbusybox-w32-e0ef52d2fabdb4772aaa87a417d841fe58d04e0d.tar.gz
busybox-w32-e0ef52d2fabdb4772aaa87a417d841fe58d04e0d.tar.bz2
busybox-w32-e0ef52d2fabdb4772aaa87a417d841fe58d04e0d.zip
shell/ash: link forkshell to main program
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 9f916b8a3..284f49303 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -5365,6 +5365,9 @@ struct backcmd { /* result of evalbackcmd */
5365 int fd; /* file descriptor to read from */ 5365 int fd; /* file descriptor to read from */
5366 char *buf; /* buffer */ 5366 char *buf; /* buffer */
5367 int nleft; /* number of chars in buffer */ 5367 int nleft; /* number of chars in buffer */
5368#ifdef __MINGW32__
5369 struct forkshell fs;
5370#endif
5368 struct job *jp; /* job structure for command */ 5371 struct job *jp; /* job structure for command */
5369}; 5372};
5370 5373
@@ -12808,11 +12811,22 @@ procargs(int argc, char **argv)
12808 int i; 12811 int i;
12809 const char *xminusc; 12812 const char *xminusc;
12810 char **xargv; 12813 char **xargv;
12814 long int subash_handle;
12811 12815
12812 xargv = argv; 12816 xargv = argv;
12813 arg0 = xargv[0]; 12817 arg0 = xargv[0];
12814 if (argc > 0) 12818 if (argc > 0)
12815 xargv++; 12819 xargv++;
12820#ifdef __MINGW32__
12821 if (*xargv && !strncmp(*xargv,"subash",6)) {
12822 if (sscanf(*xargv+6,"%lx:%s",&subash_handle,subash_entry) == 2) {
12823 xargv++;
12824 subash_fd = _open_osfhandle(subash_handle, O_NOINHERIT);
12825 }
12826 else
12827 subash_fd = -1;
12828 }
12829#endif
12816 for (i = 0; i < NOPTS; i++) 12830 for (i = 0; i < NOPTS; i++)
12817 optlist[i] = 2; 12831 optlist[i] = 2;
12818 argptr = xargv; 12832 argptr = xargv;
@@ -12900,6 +12914,10 @@ static short profile_buf[16384];
12900extern int etext(); 12914extern int etext();
12901#endif 12915#endif
12902 12916
12917#ifdef __MINGW32__
12918#include "ash_mingw.c"
12919#endif
12920
12903/* 12921/*
12904 * Main routine. We initialize things, parse the arguments, execute 12922 * Main routine. We initialize things, parse the arguments, execute
12905 * profiles if we're a login shell, and then call cmdloop to execute 12923 * profiles if we're a login shell, and then call cmdloop to execute
@@ -13014,6 +13032,9 @@ int ash_main(int argc, char **argv)
13014 } 13032 }
13015#endif 13033#endif
13016 state4: /* XXX ??? - why isn't this before the "if" statement */ 13034 state4: /* XXX ??? - why isn't this before the "if" statement */
13035#ifdef __MINGW32__
13036 subshell_run();
13037#endif
13017 cmdloop(1); 13038 cmdloop(1);
13018 } 13039 }
13019#if PROFILE 13040#if PROFILE