projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change off64_t into uint64_t
[fio.git]
/
init.c
diff --git
a/init.c
b/init.c
index 738342799c5cc391494b43d3de8433939698cb35..60c857611d3cc26c316c545f0fafcc0b851a2693 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-852,11
+852,6
@@
static int fixup_options(struct thread_data *td)
o->unit_base = N2S_BYTEPERSEC;
}
o->unit_base = N2S_BYTEPERSEC;
}
-#ifndef FIO_HAVE_ANY_FALLOCATE
- /* Platform doesn't support any fallocate so force it to none */
- o->fallocate_mode = FIO_FALLOCATE_NONE;
-#endif
-
#ifndef CONFIG_FDATASYNC
if (o->fdatasync_blocks) {
log_info("fio: this platform does not support fdatasync()"
#ifndef CONFIG_FDATASYNC
if (o->fdatasync_blocks) {
log_info("fio: this platform does not support fdatasync()"
@@
-1273,8
+1268,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
+1347,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);
}
@@
-1438,7
+1432,7
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
int recursed, int client_type)
{
unsigned int i;
int recursed, int client_type)
{
unsigned int i;
- char fname[PATH_MAX];
+ char fname[PATH_MAX
+ 1
];
int numjobs, file_alloced;
struct thread_options *o = &td->o;
char logname[PATH_MAX + 32];
int numjobs, file_alloced;
struct thread_options *o = &td->o;
char logname[PATH_MAX + 32];
@@
-1887,7
+1881,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
+1914,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
+1983,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,19
+2023,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, strlen(filename));
- full_fn[len - 1] = 0;
filename = full_fn;
}
filename = full_fn;
}