summaryrefslogtreecommitdiff
path: root/io_u.c
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2018-03-16 08:44:35 -0700
committerBart Van Assche <bart.vanassche@wdc.com>2018-03-16 12:31:20 -0700
commit93b45bb2e4c511f2d9a9a7552d74e1d921b0bf76 (patch)
treef3fd932e5b29d0fedf243684a07f056855a52a6c /io_u.c
parent69b98f11d62cb12482130fac79b8ebf00c0bb139 (diff)
downloadfio-93b45bb2e4c511f2d9a9a7552d74e1d921b0bf76.tar.gz
fio-93b45bb2e4c511f2d9a9a7552d74e1d921b0bf76.tar.bz2
Make sure that assert() expressions do not have side effects
Assert statements are compiled out if NDEBUG is defined. Hence make sure that the expressions passed to assert do not have side effects. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Diffstat (limited to 'io_u.c')
-rw-r--r--io_u.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/io_u.c b/io_u.c
index 01b36938..84d93155 100644
--- a/io_u.c
+++ b/io_u.c
@@ -1558,6 +1558,7 @@ bool queue_full(const struct thread_data *td)
struct io_u *__get_io_u(struct thread_data *td)
{
struct io_u *io_u = NULL;
+ int ret;
if (td->stop_io)
return NULL;
@@ -1594,7 +1595,8 @@ again:
* return one
*/
assert(!(td->flags & TD_F_CHILD));
- assert(!pthread_cond_wait(&td->free_cond, &td->io_u_lock));
+ ret = pthread_cond_wait(&td->free_cond, &td->io_u_lock);
+ assert(ret == 0);
goto again;
}