workqueue: style cleanup
[fio.git] / init.c
diff --git a/init.c b/init.c
index 5e6d54f3e89a97c4a415e028b438e9419143e44d..ba5bf2fbf4bb9b55bc61267e7ff0e3e8889bbd04 100644 (file)
--- a/init.c
+++ b/init.c
@@ -749,7 +749,7 @@ static int fixup_options(struct thread_data *td)
        /*
         * If randseed is set, that overrides randrepeat
         */
-       if (td->o.rand_seed)
+       if (fio_option_is_set(&td->o, rand_seed))
                td->o.rand_repeatable = 0;
 
        if ((td->io_ops->flags & FIO_NOEXTEND) && td->o.file_append) {
@@ -966,14 +966,10 @@ static int setup_random_seeds(struct thread_data *td)
        unsigned long seed;
        unsigned int i;
 
-       if (!td->o.rand_repeatable && !td->o.rand_seed)
+       if (!td->o.rand_repeatable && !fio_option_is_set(&td->o, rand_seed))
                return init_random_state(td, td->rand_seeds, sizeof(td->rand_seeds));
 
-       if (!td->o.rand_seed)
-               seed = 0x89;
-       else
-               seed = td->o.rand_seed;
-
+       seed = td->o.rand_seed;
        for (i = 0; i < 4; i++)
                seed *= 0x9e370001UL;
 
@@ -2245,7 +2241,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                        /* if --client parameter contains a pathname */
                        if (0 == access(optarg, R_OK)) {
                                /* file contains a list of host addrs or names */
-                               char hostaddr[_POSIX_HOST_NAME_MAX] = {0};
+                               char hostaddr[PATH_MAX] = {0};
                                char formatstr[8];
                                FILE * hostf = fopen(optarg, "r");
                                if (!hostf) {
@@ -2254,8 +2250,11 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                                        exit_val = 1;
                                        break;
                                }
-                               sprintf(formatstr, "%%%ds", _POSIX_HOST_NAME_MAX-1);
-                               /* read at most _POSIX_HOST_NAME_MAX-1 chars from each record in this file */
+                               sprintf(formatstr, "%%%ds", PATH_MAX - 1);
+                               /*
+                                * read at most PATH_MAX-1 chars from each
+                                * record in this file
+                                */
                                while (fscanf(hostf, formatstr, hostaddr) == 1) {
                                        /* expect EVERY host in file to be valid */
                                        if (fio_client_add(&fio_client_ops, hostaddr, &cur_client)) {