On Sunday 22 March 2009 19:12:58 Mike Frysinger wrote:
> On Saturday 21 March 2009 15:54:51 Denys Vlasenko wrote:
> > On Thursday 19 March 2009 13:07, Mike Frysinger wrote:
> > > yes, but there are sub-features which are no go's atm.  job support
> > > (obviously) and sub shells (not so obvious depending on the code).
> >
> > IIRC job control in hush is the same as on MMU. There is no reason
> > it should be more limited.
>
> jobs is non-existent ... enable job support and force nommu support and
> you'll see it not work.
> hush: can't exec 'jobs': No such file or directory

this is because jobs support implies being able to ctrl+z a foreground script.

something like this:
$ while :;do :;done

since ctrl+z requires fork() in order to background this snippet, we get a 
link failure.

how about this ?  we retain most common job functionality (putting a random 
process into the bg/fg like `ping`).

--- shell/hush.c        (revision 25789)
+++ shell/hush.c        (working copy)
@@ -94,11 +94,6 @@
 #warning For more info see shell/hush.c, generate_stream_from_list().
 #endif
 
-#if !BB_MMU && ENABLE_HUSH_JOB
-#undef ENABLE_HUSH_JOB
-#define ENABLE_HUSH_JOB 0
-#endif
-
 #if !ENABLE_HUSH_INTERACTIVE
 #undef ENABLE_FEATURE_EDITING
 #define ENABLE_FEATURE_EDITING 0
@@ -807,6 +802,7 @@ static void handler_ctrl_c(int sig UNUSE
 
 static void handler_ctrl_z(int sig UNUSED_PARAM)
 {
+#if BB_MMU
        pid_t pid;
 
        debug_printf_jobs("got tty sig %d in pid %d\n", sig, getpid());
@@ -835,6 +831,10 @@ static void handler_ctrl_z(int sig UNUSE
 // as usual we can have all kinds of nasty problems with leaked malloc data 
here
        debug_printf_jobs("siglongjmp in parent\n");
        siglongjmp(G.toplevel_jb, 1);
+#else
+       fputs("Sorry, CTRL+Z not supported on nommu\n", stderr);
+       debug_printf_jobs("got tty sig %d in pid %d\n", sig, getpid());
+#endif
 }
 
 /* Restores tty foreground process group, and exits.
-mike
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to