[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: hush: job checks and no commands
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2009-03-28 22:28:37
Message-ID: 200903282328.37667.vda.linux () googlemail ! com
[Download RAW message or body]

On Saturday 28 March 2009 13:48, Mike Frysinger wrote:
> if you run a job in the background with bash, then simply hitting return for a 
> new prompt will check jobs:
> $ sleep 1 &
> $
> $
> [1] Done		sleep 1
> $
> 
> under hush, jobs are only checked when a command is processed.  so you'd have 
> to do like:
> $ sleep 1 &
> $ :
> $ :
> [1] Done		sleep 1
> $
> 
> how about this simple change ?
> -mike
> 
> --- shell/hush.c	(revision 25852)
> +++ shell/hush.c	(working copy)
> @@ -2771,7 +2771,7 @@ static int run_list(struct pipe *pi)
>  		}
>  #endif
>  		if (pi->num_cmds == 0)
> -			continue;
> +			goto check_jobs_and_continue;
>  
>  		/* After analyzing all keywords and conditions, we decided
>  		 * to execute this pipe. NB: has to do checkjobs(NULL)
> @@ -2858,6 +2858,8 @@ static int run_list(struct pipe *pi)
>  		) {
>  			skip_more_for_this_rword = rword;
>  		}
> +
> + check_jobs_and_continue:
>  		checkjobs(NULL);
>  	} /* for (pi) */

Looks ok.
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic