Index: uspace/lib/c/generic/task.c
===================================================================
--- uspace/lib/c/generic/task.c	(revision e0e7ebacb0769fd1a0bc760347da23ebb0b909ed)
+++ uspace/lib/c/generic/task.c	(revision 5044114fbee4c5e1d76373641fe69c88fb17fa88)
@@ -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);
 	}
 
