--- fs_mark.c.orig Fri Dec 13 02:16:07 2013 +++ fs_mark.c Fri Dec 13 02:30:02 2013 @@ -29,8 +29,9 @@ char *fs_mark_version = "3.3"; #include #include #include -#include #include +#include +#include #include #include @@ -41,11 +42,8 @@ char *fs_mark_version = "3.3"; #include #include #include +#include -#include -#include -#include - #include "fs_mark.h" void cleanup_exit(void) @@ -406,9 +404,9 @@ void setup_file_name(int file_index, pid_t my_pid) * Pick a random name, making sure that it is either a letter or digit */ do { - long int val; + u_int32_t val; - val = random(); + val = arc4random_uniform(0x7f+1); rand_name[j] = '0' + (val & 0x7f); } while (!(isupper(rand_name[j]) || isdigit(rand_name[j]))); } @@ -446,7 +444,7 @@ void setup(pid_t pid) * Initialize the random functions for this program. */ (void)gettimeofday(&now, (struct timezone *)0); - srandom((long)now.tv_usec); + /*srandom((long)now.tv_usec); */ if (num_subdirs > 0) { /*