[BusyBox] Re: busybox-cvs Digest, Vol 12, Issue 9

Vladimir N. Oleynik dzo at simtreas.ru
Mon Mar 15 08:25:32 UTC 2004


Paul,

> Date: Thu, 11 Mar 2004 13:34:27 +0000
> From: Erik Andersen <andersen at busybox.net>
> Subject: [BusyBox-cvs] busybox/shell ash.c,1.90,1.91
> 
> Modified Files:
> 	ash.c 
> Log Message:
> Paul Mundt, lethal at linux-sh dot org writes:
> 
> Here's a follow-up replacement to the patch I sent earlier, this adjusts some
> of the semantics of the dynamic variable setting. Namely, dynamic vars can hook
> a set handler (which RANDOM uses to adjust the seed). They'll only lose their
> dynamic status if they're unset.
> 
> I've used the same approach that bash does to come up with the random number,
> mostly just for consistency.

Your patch have many problem.
1. You always added + time(). This cannot reset RANDOM=value for debuging with
replay sequential.
2. Hmm. I examine bash 2.04 source. This pseudorandom generator use low bits of
counter value. You use high bits. This make bad pseudorandom values after have
0-value. For example, if + time() do remove, your generator always return 0 after
first generate 0.
3. Memory leak per call. Use ash-unlike unecessary bb_strdup function.
4. Unsupport show last $RANDOM value for "set" and "export" command.
5. Bloat code. Busybox-unlike patch - added unstandart feature as default hardcode.

Last patch attached.

Erik, why you apply Paul patch with have 5-th point problem? :(

Last patch have ash change xwrite() to fresh libbb/bb_full_write interfase 
(haved loop after EINTR).


--w
vodz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: last_patch129.gz
Type: application/x-tar
Size: 3935 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20040315/0c853a9f/attachment.tar 


More information about the busybox mailing list