On Tue, Jul 27, 2010 at 08:43:36 +0200, Denys Vlasenko wrote:
> On Monday 26 July 2010 15:22, Alexander Shishkin wrote:
> > I didn't dig any farther than the bash manual, which suggests that
> > the default behavior of ulimit when neither -H nor -S is set is to
> > change both soft and hard limits. This has been the case in earlier
> > versions of busybox, too.
> > 
> > Signed-off-by: Alexander Shishkin <[email protected]>
> > ---
> >  shell/shell_common.c |    7 ++++++-
> >  1 files changed, 6 insertions(+), 1 deletions(-)
> > 
> > diff --git a/shell/shell_common.c b/shell/shell_common.c
> > index 3114ff3..7ddf67b 100644
> > --- a/shell/shell_common.c
> > +++ b/shell/shell_common.c
> > @@ -430,8 +430,13 @@ shell_builtin_ulimit(char **argv)
> >  //bb_error_msg("opt %c val_str:'%s' val:%lld", opt_char, val_str, (long 
> > long)val);
> >                                     if (opts & OPT_hard)
> >                                             limit.rlim_max = val;
> > -                                   if ((opts & OPT_soft) || opts == 0)
> > +                                   if (opts & OPT_soft)
> >                                             limit.rlim_cur = val;
> > +                                   /* from man bash: "If neither -H nor -S
> > +                                    * is specified, both the soft and hard
> > +                                    * limits are set. */
> > +                                   if (!opts)
> > +                                           limit.rlim_max = limit.rlim_cur 
> > = val;
> 
> +26 bytes. Whereas
> 
> +                                       if (!opts)
> +                                               opts = OPT_hard + OPT_soft;
> 
> is only +4 bytes.

My bad.

Regards,
--
Alex
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to