1 --- /home/nickolai/build/uClibc-0.9.29_rc1/libc/misc/internals/tempname.c 2006-01-27 13:26:40.000000000 -0800
2 +++ tempname.c 2007-05-02 13:25:05.000000000 -0700
4 int attribute_hidden __gen_tempname (char *tmpl, int kind)
8 + unsigned int i, count;
9 int fd, save_errno = errno;
10 unsigned char randomness[6];
16 - /* Get some random data. */
17 - if (fillrand(randomness, sizeof(randomness)) != sizeof(randomness)) {
18 - /* if random device nodes failed us, lets use the braindamaged ver */
19 - brain_damaged_fillrand(randomness, sizeof(randomness));
22 - for (i = 0; i < sizeof(randomness); ++i)
23 - XXXXXX[i] = letters[(randomness[i]) % NUM_LETTERS];
24 + for (count = 0; count < TMP_MAX; ++count) {
25 + /* Get some random data. */
26 + if (fillrand(randomness, sizeof(randomness)) != sizeof(randomness)) {
27 + /* if random device nodes failed us, lets use the braindamaged ver */
28 + brain_damaged_fillrand(randomness, sizeof(randomness));
31 - for (i = 0; i < TMP_MAX; ++i) {
32 + for (i = 0; i < sizeof(randomness); ++i)
33 + XXXXXX[i] = letters[(randomness[i]) % NUM_LETTERS];