Index: uspace/lib/c/generic/task.c
===================================================================
--- uspace/lib/c/generic/task.c	(revision e0e7ebacb0769fd1a0bc760347da23ebb0b909ed)
+++ uspace/lib/c/generic/task.c	(revision 55fe22044a62f061c5f26a03928ac9bea434ff4c)
@@ -395,13 +395,12 @@
 errno_t task_wait(task_wait_t *wait, task_exit_t *texit, int *retval)
 {
-	assert(texit);
-	assert(retval);
-
 	errno_t rc;
 	async_wait_for(wait->aid, &rc);
-
+	
 	if (rc == EOK) {
-		*texit = ipc_get_arg1(&wait->result);
-		*retval = ipc_get_arg2(&wait->result);
+		if (wait->flags & TASK_WAIT_EXIT && texit)
+			*texit = ipc_get_arg1(wait->result);
+		if (wait->flags & TASK_WAIT_RETVAL && retval)
+			*retval = ipc_get_arg2(wait->result);
 	}
 
