Index: uspace/app/bdsh/exec.c
===================================================================
--- uspace/app/bdsh/exec.c	(revision d9fae23532028671526d24c90116318f54d92d29)
+++ uspace/app/bdsh/exec.c	(revision 5f69504acd57bfcce8f4f6c1d97b5ce32635bc21)
@@ -41,4 +41,5 @@
 #include <fcntl.h>
 #include <str_error.h>
+#include <errno.h>
 
 #include "config.h"
@@ -116,24 +117,26 @@
 	task_exit_t texit;
 	char *tmp;
-	int retval;
+	int rc, retval;
 
 	tmp = str_dup(find_command(cmd));
 	free(found);
 
-	tid = task_spawn(tmp, (const char **) argv, &retval);
+	rc = task_spawnv(&tid, tmp, (const char **) argv);
 	free(tmp);
 
-	if (tid == 0) {
+	if (rc != 0) {
 		cli_error(CL_EEXEC, "%s: Cannot spawn `%s' (%s)", progname, cmd,
-		    str_error(retval));
+		    str_error(rc));
 		return 1;
 	}
 	
-	task_wait(tid, &texit, &retval);
-	if (texit != TASK_EXIT_NORMAL) {
+	rc = task_wait(tid, &texit, &retval);
+	if (rc != EOK) {
+		printf("%s: Failed waiting for command (%s)\n", str_error(rc));
+	} else if (texit != TASK_EXIT_NORMAL) {
 		printf("%s: Command failed (unexpectedly terminated)\n", progname);
 	} else if (retval != 0) {
-		printf("%s: Command failed (%s)\n",
-		    progname, str_error(retval));
+		printf("%s: Command failed (exit code %d)\n",
+		    progname, retval);
 	}
 
