diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-28 19:08:23 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-28 19:08:23 +0000 |
commit | a2333c8938af4829a8eac8c09615e6652cd412f1 (patch) | |
tree | 480f2729015c99231325990516c74a47ee30d8cd | |
parent | 78f9d8eb7adc10f1af8977212f24ab3c418a9c2b (diff) | |
download | busybox-w32-a2333c8938af4829a8eac8c09615e6652cd412f1.tar.gz busybox-w32-a2333c8938af4829a8eac8c09615e6652cd412f1.tar.bz2 busybox-w32-a2333c8938af4829a8eac8c09615e6652cd412f1.zip |
randomtest fixes
-rw-r--r-- | libbb/sha1.c | 11 | ||||
-rw-r--r-- | loginutils/adduser.c | 2 | ||||
-rwxr-xr-x | scripts/randomtest | 4 | ||||
-rw-r--r-- | util-linux/mkfs_vfat.c | 17 |
4 files changed, 23 insertions, 11 deletions
diff --git a/libbb/sha1.c b/libbb/sha1.c index a07435919..9fa095e85 100644 --- a/libbb/sha1.c +++ b/libbb/sha1.c | |||
@@ -196,12 +196,11 @@ static void FAST_FUNC sha256_process_block64(sha256_ctx_t *ctx) | |||
196 | 196 | ||
197 | /* The actual computation according to FIPS 180-2:6.2.2 step 3. */ | 197 | /* The actual computation according to FIPS 180-2:6.2.2 step 3. */ |
198 | for (t = 0; t < 64; ++t) { | 198 | for (t = 0; t < 64; ++t) { |
199 | /* Need to fetch upper half of sha_K[t] */ | 199 | /* Need to fetch upper half of sha_K[t] |
200 | #if BB_BIG_ENDIAN | 200 | * (I hope compiler is clever enough to just fetch |
201 | uint32_t K_t = ((uint32_t*)(sha_K + t))[0]; | 201 | * upper half) |
202 | #else | 202 | */ |
203 | uint32_t K_t = ((uint32_t*)(sha_K + t))[1]; | 203 | uint32_t K_t = sha_K[t] >> 32; |
204 | #endif | ||
205 | uint32_t T1 = h + S1(e) + Ch(e, f, g) + K_t + W[t]; | 204 | uint32_t T1 = h + S1(e) + Ch(e, f, g) + K_t + W[t]; |
206 | uint32_t T2 = S0(a) + Maj(a, b, c); | 205 | uint32_t T2 = S0(a) + Maj(a, b, c); |
207 | h = g; | 206 | h = g; |
diff --git a/loginutils/adduser.c b/loginutils/adduser.c index 17b5088ec..b94bb3aea 100644 --- a/loginutils/adduser.c +++ b/loginutils/adduser.c | |||
@@ -89,7 +89,9 @@ int adduser_main(int argc UNUSED_PARAM, char **argv) | |||
89 | struct passwd pw; | 89 | struct passwd pw; |
90 | const char *usegroup = NULL; | 90 | const char *usegroup = NULL; |
91 | FILE *file; | 91 | FILE *file; |
92 | #if ENABLE_FEATURE_SHADOWPASSWDS | ||
92 | int fd; | 93 | int fd; |
94 | #endif | ||
93 | 95 | ||
94 | #if ENABLE_FEATURE_ADDUSER_LONG_OPTIONS | 96 | #if ENABLE_FEATURE_ADDUSER_LONG_OPTIONS |
95 | applet_long_options = adduser_longopts; | 97 | applet_long_options = adduser_longopts; |
diff --git a/scripts/randomtest b/scripts/randomtest index d9d3959be..7b80f4a2a 100755 --- a/scripts/randomtest +++ b/scripts/randomtest | |||
@@ -90,7 +90,7 @@ mv .config.new .config | |||
90 | # Regenerate .config with default answers for yanked-off options | 90 | # Regenerate .config with default answers for yanked-off options |
91 | { yes "" | make oldconfig >/dev/null; } || exit 1 | 91 | { yes "" | make oldconfig >/dev/null; } || exit 1 |
92 | 92 | ||
93 | nice -n 10 make | 93 | nice -n 10 make 2>&1 | tee -a make.log |
94 | 94 | ||
95 | test -x busybox && { | 95 | test -x busybox && { |
96 | cd .. | 96 | cd .. |
@@ -99,5 +99,5 @@ test -x busybox && { | |||
99 | } | 99 | } |
100 | 100 | ||
101 | cd .. | 101 | cd .. |
102 | mv "$dir" failed."$dir" | 102 | mv "$dir" "failed.$dir" |
103 | exit 1 | 103 | exit 1 |
diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c index 705c75c20..72c2058b5 100644 --- a/util-linux/mkfs_vfat.c +++ b/util-linux/mkfs_vfat.c | |||
@@ -323,9 +323,20 @@ int mkfs_vfat_main(int argc UNUSED_PARAM, char **argv) | |||
323 | * fs size <= 16G: 8k clusters | 323 | * fs size <= 16G: 8k clusters |
324 | * fs size > 16G: 16k clusters | 324 | * fs size > 16G: 16k clusters |
325 | */ | 325 | */ |
326 | sect_per_clust = volume_size_bytes >= ((off_t)16)*1024*1024*1024 ? 32 : | 326 | sect_per_clust = 1; |
327 | volume_size_bytes >= ((off_t)8)*1024*1024*1024 ? 16 : | 327 | if (volume_size_bytes >= 260*1024*1024) { |
328 | volume_size_bytes >= 260*1024*1024 ? 8 : 1; | 328 | sect_per_clust = 8; |
329 | /* fight gcc: */ | ||
330 | /* "error: integer overflow in expression" */ | ||
331 | /* "error: right shift count >= width of type" */ | ||
332 | if (sizeof(off_t) > 4) { | ||
333 | unsigned t = (volume_size_bytes >> 31 >> 1); | ||
334 | if (t >= 8/4) | ||
335 | sect_per_clust = 16; | ||
336 | if (t >= 16/4) | ||
337 | sect_per_clust = 32; | ||
338 | } | ||
339 | } | ||
329 | } else { | 340 | } else { |
330 | // floppy, loop, or regular file | 341 | // floppy, loop, or regular file |
331 | int not_floppy = ioctl(dev, FDGETPRM, ¶m); | 342 | int not_floppy = ioctl(dev, FDGETPRM, ¶m); |