Index: uspace/app/taskdump/taskdump.c
===================================================================
--- uspace/app/taskdump/taskdump.c	(revision c21d4d64870698b91707f203def6398db79bff84)
+++ uspace/app/taskdump/taskdump.c	(revision db17889bee0fb7290817c49d4d45538cfa61532b)
@@ -126,21 +126,22 @@
 static errno_t connect_task(task_id_t task_id)
 {
-	async_sess_t *ksess = async_connect_kbox(task_id);
+	errno_t rc;
+	async_sess_t *ksess = async_connect_kbox(task_id, &rc);
 
 	if (!ksess) {
-		if (errno == ENOTSUP) {
+		if (rc == ENOTSUP) {
 			printf("You do not have userspace debugging support "
 			    "compiled in the kernel.\n");
 			printf("Compile kernel with 'Support for userspace debuggers' "
 			    "(CONFIG_UDEBUG) enabled.\n");
-			return errno;
+			return rc;
 		}
 
 		printf("Error connecting\n");
 		printf("async_connect_kbox(%" PRIu64 ") -> %s", task_id, str_error_name(errno));
-		return errno;
-	}
-
-	errno_t rc = udebug_begin(ksess);
+		return rc;
+	}
+
+	rc = udebug_begin(ksess);
 	if (rc != EOK) {
 		printf("udebug_begin() -> %s\n", str_error_name(rc));
