projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Makefile: fix fio version gen
[fio.git]
/
backend.c
diff --git
a/backend.c
b/backend.c
index a4367672d68ce80c88dc828245c2467aa1f6917c..f91f3caf9b7d82fe31b0385d5942a7b4f4414318 100644
(file)
--- a/
backend.c
+++ b/
backend.c
@@
-1458,16
+1458,17
@@
static bool keep_running(struct thread_data *td)
return false;
}
return false;
}
-static int exec_string(struct thread_options *o, const char *string, const char *mode)
+static int exec_string(struct thread_options *o, const char *string,
+ const char *mode)
{
{
- size_t newlen = strlen(string) + strlen(o->name) + strlen(mode) + 13 + 1;
int ret;
char *str;
int ret;
char *str;
- str = malloc(newlen);
-
sprintf(str, "%s > %s.%s.txt 2>&1", string, o->name, mode)
;
+ if (asprintf(&str, "%s > %s.%s.txt 2>&1", string, o->name, mode) < 0)
+
return -1
;
- log_info("%s : Saving output of %s in %s.%s.txt\n",o->name, mode, o->name, mode);
+ log_info("%s : Saving output of %s in %s.%s.txt\n", o->name, mode,
+ o->name, mode);
ret = system(str);
if (ret == -1)
log_err("fio: exec of cmd <%s> failed\n", str);
ret = system(str);
if (ret == -1)
log_err("fio: exec of cmd <%s> failed\n", str);
@@
-1731,7
+1732,7
@@
static void *thread_main(void *data)
if (!init_random_map(td))
goto err;
if (!init_random_map(td))
goto err;
- if (o->exec_prerun && exec_string(o, o->exec_prerun,
(const char *)
"prerun"))
+ if (o->exec_prerun && exec_string(o, o->exec_prerun, "prerun"))
goto err;
if (o->pre_read && !pre_read_files(td))
goto err;
if (o->pre_read && !pre_read_files(td))
@@
-1890,7
+1891,7
@@
static void *thread_main(void *data)
rate_submit_exit(td);
if (o->exec_postrun)
rate_submit_exit(td);
if (o->exec_postrun)
- exec_string(o, o->exec_postrun,
(const char *)
"postrun");
+ exec_string(o, o->exec_postrun, "postrun");
if (exitall_on_terminate || (o->exitall_error && td->error))
fio_terminate_threads(td->groupid, td->o.exit_what);
if (exitall_on_terminate || (o->exitall_error && td->error))
fio_terminate_threads(td->groupid, td->o.exit_what);
@@
-2042,6
+2043,7
@@
reaped:
done_secs += mtime_since_now(&td->epoch) / 1000;
profile_td_exit(td);
done_secs += mtime_since_now(&td->epoch) / 1000;
profile_td_exit(td);
+ flow_exit_job(td);
}
if (*nr_running == cputhreads && !pending && realthreads)
}
if (*nr_running == cputhreads && !pending && realthreads)