projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Fix timout variable setting
[fio.git]
/
init.c
diff --git
a/init.c
b/init.c
index b310f6633236ac4720b4ef8f7375bcfddea5d276..81674aa4b5f6425af0188b9542bdacb088bd442f 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-625,7
+625,7
@@
static int str_ioengine_cb(struct thread_data *td, char *str)
/*
* This is our [ini] type file parser.
*/
/*
* This is our [ini] type file parser.
*/
-int parse_jobs_ini(char *file)
+int parse_jobs_ini(char *file
, int stonewall_flag
)
{
unsigned int prioclass, prio, cpu, global, il;
unsigned long long ull;
{
unsigned int prioclass, prio, cpu, global, il;
unsigned long long ull;
@@
-635,7
+635,7
@@
int parse_jobs_ini(char *file)
fpos_t off;
FILE *f;
char *p;
fpos_t off;
FILE *f;
char *p;
- int ret = 0, stonewall
= 1
;
+ int ret = 0, stonewall;
f = fopen(file, "r");
if (!f) {
f = fopen(file, "r");
if (!f) {
@@
-647,6
+647,7
@@
int parse_jobs_ini(char *file)
name = malloc(256);
tmpbuf = malloc(4096);
name = malloc(256);
tmpbuf = malloc(4096);
+ stonewall = stonewall_flag;
while ((p = fgets(string, 4096, f)) != NULL) {
if (ret)
break;
while ((p = fgets(string, 4096, f)) != NULL) {
if (ret)
break;
@@
-749,7
+750,7
@@
int parse_jobs_ini(char *file)
continue;
}
if (!check_str_time(p, "timeout", &ull)) {
continue;
}
if (!check_str_time(p, "timeout", &ull)) {
- td->timeout = ul
1
;
+ td->timeout = ul
l
;
fgetpos(f, &off);
continue;
}
fgetpos(f, &off);
continue;
}
@@
-1032,18
+1033,12
@@
static int parse_cmd_line(int argc, char *argv[])
{
int c, idx = 1, ini_idx = 0;
{
int c, idx = 1, ini_idx = 0;
- while ((c = getopt(argc, argv, "t:o:
f:
lwvhm")) != EOF) {
+ while ((c = getopt(argc, argv, "t:o:lwvhm")) != EOF) {
switch (c) {
case 't':
def_timeout = atoi(optarg);
idx++;
break;
switch (c) {
case 't':
def_timeout = atoi(optarg);
idx++;
break;
- case 'f':
- ini_idx++;
- ini_file = realloc(ini_file, ini_idx * sizeof(char *));
- ini_file[ini_idx - 1] = strdup(optarg);
- idx++;
- break;
case 'l':
write_lat_log = 1;
idx++;
case 'l':
write_lat_log = 1;
idx++;
@@
-1157,7
+1152,7
@@
int parse_options(int argc, char *argv[])
for (i = 0; i < job_files; i++) {
if (fill_def_thread())
return 1;
for (i = 0; i < job_files; i++) {
if (fill_def_thread())
return 1;
- if (parse_jobs_ini(ini_file[i]))
+ if (parse_jobs_ini(ini_file[i]
, i
))
return 1;
free(ini_file[i]);
}
return 1;
free(ini_file[i]);
}