X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=parse.c;h=fd5605f0c33f2bdb56dea64012b658d7d7c82b40;hb=be391e20c4db6dc8d3be3af0811419741fe5fd6e;hp=518c2dff45f0052c1a7c7da01f61db751b7835d2;hpb=d694a6a7c02f577b2bb5d0ad24331b775acf6869;p=fio.git diff --git a/parse.c b/parse.c index 518c2dff..fd5605f0 100644 --- a/parse.c +++ b/parse.c @@ -167,7 +167,7 @@ static unsigned long long get_mult_time(const char *str, int len, else if (!strcmp("h", c)) mult = 60 * 60 * 1000000UL; else if (!strcmp("d", c)) - mult = 24 * 60 * 60 * 1000000UL; + mult = 24 * 60 * 60 * 1000000ULL; free(c); return mult; @@ -1319,6 +1319,23 @@ void options_init(struct fio_option *options) } } +void options_mem_dupe(struct fio_option *options, void *data) +{ + struct fio_option *o; + char **ptr; + + dprint(FD_PARSE, "dup options\n"); + + for (o = &options[0]; o->name; o++) { + if (o->type != FIO_OPT_STR_STORE) + continue; + + ptr = td_var(data, o, o->off1); + if (*ptr) + *ptr = strdup(*ptr); + } +} + void options_free(struct fio_option *options, void *data) { struct fio_option *o;