diff options
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/shell/ash.c b/shell/ash.c index cc2677126..d81dbd3f5 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -4725,10 +4725,12 @@ forkshell(struct job *jp, union node *n, int mode) | |||
4725 | freejob(jp); | 4725 | freejob(jp); |
4726 | ash_msg_and_raise_error("can't fork"); | 4726 | ash_msg_and_raise_error("can't fork"); |
4727 | } | 4727 | } |
4728 | if (pid == 0) | 4728 | if (pid == 0) { |
4729 | CLEAR_RANDOM_T(&random_gen); /* or else $RANDOM repeats in child */ | ||
4729 | forkchild(jp, n, mode); | 4730 | forkchild(jp, n, mode); |
4730 | else | 4731 | } else { |
4731 | forkparent(jp, n, mode, pid); | 4732 | forkparent(jp, n, mode, pid); |
4733 | } | ||
4732 | return pid; | 4734 | return pid; |
4733 | } | 4735 | } |
4734 | 4736 | ||
@@ -10079,12 +10081,6 @@ setcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
10079 | static void FAST_FUNC | 10081 | static void FAST_FUNC |
10080 | change_random(const char *value) | 10082 | change_random(const char *value) |
10081 | { | 10083 | { |
10082 | /* Galois LFSR parameter */ | ||
10083 | /* Taps at 32 31 29 1: */ | ||
10084 | enum { MASK = 0x8000000b }; | ||
10085 | /* Another example - taps at 32 31 30 10: */ | ||
10086 | /* MASK = 0x00400007 */ | ||
10087 | |||
10088 | uint32_t t; | 10084 | uint32_t t; |
10089 | 10085 | ||
10090 | if (value == NULL) { | 10086 | if (value == NULL) { |
@@ -13268,11 +13264,6 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |||
13268 | #endif | 13264 | #endif |
13269 | rootpid = getpid(); | 13265 | rootpid = getpid(); |
13270 | 13266 | ||
13271 | #if ENABLE_ASH_RANDOM_SUPPORT | ||
13272 | /* Can use monotonic_ns() for better randomness but for now it is | ||
13273 | * not used anywhere else in busybox... so avoid bloat */ | ||
13274 | INIT_RANDOM_T(&random_gen, rootpid, monotonic_us()); | ||
13275 | #endif | ||
13276 | init(); | 13267 | init(); |
13277 | setstackmark(&smark); | 13268 | setstackmark(&smark); |
13278 | procargs(argv); | 13269 | procargs(argv); |