Index: kernel/generic/src/synch/condvar.c
===================================================================
--- kernel/generic/src/synch/condvar.c	(revision 497bd656d30dfa5181c542cab4d9d1807cbe1bbd)
+++ kernel/generic/src/synch/condvar.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
@@ -80,5 +80,5 @@
  * For exact description of meaning of possible combinations of usec and flags,
  * see comment for waitq_sleep_timeout().  Note that when
- * SYNCH_FLAGS_NON_BLOCKING is specified here, ESYNCH_WOULD_BLOCK is always
+ * SYNCH_FLAGS_NON_BLOCKING is specified here, EAGAIN is always
  * returned.
  *
@@ -89,4 +89,5 @@
 	int rc;
 	ipl_t ipl;
+	bool blocked;
 
 	ipl = waitq_sleep_prepare(&cv->wq);
@@ -95,7 +96,8 @@
 
 	cv->wq.missed_wakeups = 0;	/* Enforce blocking. */
-	rc = waitq_sleep_timeout_unsafe(&cv->wq, usec, flags);
+	rc = waitq_sleep_timeout_unsafe(&cv->wq, usec, flags, &blocked);
+	assert(blocked || rc != EOK);
 
-	waitq_sleep_finish(&cv->wq, rc, ipl);
+	waitq_sleep_finish(&cv->wq, blocked, ipl);
 	/* Lock only after releasing the waitq to avoid a possible deadlock. */
 	mutex_lock(mtx);
@@ -117,5 +119,5 @@
  * For exact description of meaning of possible combinations of usec and flags,
  * see comment for waitq_sleep_timeout().  Note that when
- * SYNCH_FLAGS_NON_BLOCKING is specified here, ESYNCH_WOULD_BLOCK is always
+ * SYNCH_FLAGS_NON_BLOCKING is specified here, EAGAIN is always
  * returned.
  *
@@ -127,5 +129,6 @@
 	int rc;
 	ipl_t ipl;
-	
+	bool blocked;
+
 	ipl = waitq_sleep_prepare(&cv->wq);
 
@@ -134,7 +137,8 @@
 
 	cv->wq.missed_wakeups = 0;	/* Enforce blocking. */
-	rc = waitq_sleep_timeout_unsafe(&cv->wq, usec, flags);
+	rc = waitq_sleep_timeout_unsafe(&cv->wq, usec, flags, &blocked);
+	assert(blocked || rc != EOK);
 
-	waitq_sleep_finish(&cv->wq, rc, ipl);
+	waitq_sleep_finish(&cv->wq, blocked, ipl);
 	/* Lock only after releasing the waitq to avoid a possible deadlock. */
 	spinlock_lock(lock);
@@ -152,5 +156,5 @@
  * For exact description of meaning of possible combinations of usec and flags,
  * see comment for waitq_sleep_timeout().  Note that when
- * SYNCH_FLAGS_NON_BLOCKING is specified here, ESYNCH_WOULD_BLOCK is always
+ * SYNCH_FLAGS_NON_BLOCKING is specified here, EAGAIN is always
  * returned.
  *
