[PATCH] Add fio_assert()
A job must not call assert(), as it wont exit and set thread
state properly.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.h b/fio.h
index ddf6694..c0b92a6 100644
--- a/fio.h
+++ b/fio.h
@@ -670,4 +670,12 @@
#define for_each_file(td, f, i) \
for ((i) = 0, (f) = &(td)->files[0]; (i) < (int) (td)->nr_files; (i)++, (f)++)
+#define fio_assert(td, cond) do { \
+ if (!(cond)) { \
+ fprintf(stderr, "file:%s:%d, assert %s failed\n", __FILE__, __LINE__, #cond); \
+ (td)->runstate = TD_EXITED; \
+ exit(0); \
+ } \
+} while (0)
+
#endif