X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio-ini.c;h=73cebf220d5f761c6797993b402a556f4af0ca27;hp=38d60a2d7dcff820af84989d2e8511f625d38762;hb=a12fc0225482bd1580a332312f2a60f73a9ebc28;hpb=b6f4d8804ad499adf10b4cad0657284a8a4a6287 diff --git a/fio-ini.c b/fio-ini.c index 38d60a2d..73cebf22 100644 --- a/fio-ini.c +++ b/fio-ini.c @@ -406,8 +406,12 @@ typedef int (str_cb_fn)(struct thread_data *, char *); static int check_str(char *p, char *name, str_cb_fn *cb, struct thread_data *td) { - char *s = strstr(p, name); + char *s; + if (strncmp(p, name, strlen(name))) + return 1; + + s = strstr(p, name); if (!s) return 1; @@ -422,8 +426,12 @@ static int check_str(char *p, char *name, str_cb_fn *cb, struct thread_data *td) static int check_strstore(char *p, char *name, char *dest) { - char *s = strstr(p, name); + char *s; + if (strncmp(p, name, strlen(name))) + return 1; + + s = strstr(p, name); if (!s) return 1; @@ -458,6 +466,9 @@ static int check_range(char *p, char *name, unsigned long *s, unsigned long *e) char option[128]; char *str, *p1, *p2; + if (strncmp(p, name, strlen(name))) + return 1; + strcpy(option, p); p = option; @@ -638,7 +649,6 @@ static int str_ioengine_cb(struct thread_data *td, char *str) static int str_iolog_cb(struct thread_data *td, char *file) { strncpy(td->iolog_file, file, sizeof(td->iolog_file) - 1); - return 0; } @@ -884,7 +894,16 @@ int parse_jobs_ini(char *file) continue; } if (!check_str(p, "iolog", str_iolog_cb, td)) { - td->iolog = 1; + printf("got read iolog\n"); + td->read_iolog = 1; + td->write_iolog = 0; + fgetpos(f, &off); + continue; + } + if (!td->read_iolog && + !check_str(p, "write_iolog", str_iolog_cb, td)) { + printf("got write iolog\n"); + td->write_iolog = 1; fgetpos(f, &off); continue; }