projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use min_bs in rate_process=poisson
[fio.git]
/
init.c
diff --git
a/init.c
b/init.c
index f2ba1e208e8f1cc44d37490501abb932c6b6ed4b..63f2168eabcbbebb8cf6c2ae96967b46f2114713 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-1273,8
+1273,7
@@
static char *make_filename(char *buf, size_t buf_size,struct thread_options *o,
for (f = &fpre_keywords[0]; f->keyword; f++)
f->strlen = strlen(f->keyword);
for (f = &fpre_keywords[0]; f->keyword; f++)
f->strlen = strlen(f->keyword);
- buf[buf_size - 1] = '\0';
- strncpy(buf, o->filename_format, buf_size - 1);
+ snprintf(buf, buf_size, "%s", o->filename_format);
memset(copy, 0, sizeof(copy));
for (f = &fpre_keywords[0]; f->keyword; f++) {
memset(copy, 0, sizeof(copy));
for (f = &fpre_keywords[0]; f->keyword; f++) {
@@
-1353,7
+1352,7
@@
static char *make_filename(char *buf, size_t buf_size,struct thread_options *o,
if (post_start)
strncpy(dst, buf + post_start, dst_left);
if (post_start)
strncpy(dst, buf + post_start, dst_left);
- s
trncpy(buf, copy, buf_size - 1
);
+ s
nprintf(buf, buf_size, "%s", copy
);
} while (1);
}
} while (1);
}
@@
-1887,7
+1886,7
@@
static int __parse_jobs_ini(struct thread_data *td,
}
}
}
}
- string = malloc(
4096
);
+ string = malloc(
OPT_LEN_MAX
);
/*
* it's really 256 + small bit, 280 should suffice
/*
* it's really 256 + small bit, 280 should suffice
@@
-1920,7
+1919,7
@@
static int __parse_jobs_ini(struct thread_data *td,
if (is_buf)
p = strsep(&file, "\n");
else
if (is_buf)
p = strsep(&file, "\n");
else
- p = fgets(string,
4096
, f);
+ p = fgets(string,
OPT_LEN_MAX
, f);
if (!p)
break;
}
if (!p)
break;
}
@@
-1989,7
+1988,7
@@
static int __parse_jobs_ini(struct thread_data *td,
if (is_buf)
p = strsep(&file, "\n");
else
if (is_buf)
p = strsep(&file, "\n");
else
- p = fgets(string,
4096
, f);
+ p = fgets(string,
OPT_LEN_MAX
, f);
if (!p)
break;
dprint(FD_PARSE, "%s", p);
if (!p)
break;
dprint(FD_PARSE, "%s", p);
@@
-2029,20
+2028,12
@@
static int __parse_jobs_ini(struct thread_data *td,
*/
if (access(filename, F_OK) &&
(ts = strrchr(file, '/'))) {
*/
if (access(filename, F_OK) &&
(ts = strrchr(file, '/'))) {
- int len = ts - file +
- strlen(filename) + 2;
-
- if (!(full_fn = calloc(1, len))) {
+ if (asprintf(&full_fn, "%.*s%s",
+ (int)(ts - file + 1), file,
+ filename) < 0) {
ret = ENOMEM;
break;
}
ret = ENOMEM;
break;
}
-
- strncpy(full_fn,
- file, (ts - file) + 1);
- strncpy(full_fn + (ts - file) + 1,
- filename,
- len - (ts - file) - 1);
- full_fn[len - 1] = 0;
filename = full_fn;
}
filename = full_fn;
}