Index: uspace/app/bdsh/cmds/modules/cat/cat.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -244,5 +244,4 @@
 		
 		bytes = read(fd, buff + copied_bytes, bytes_to_read);
-		bytes += copied_bytes;
 		copied_bytes = 0;
 
Index: uspace/app/bdsh/cmds/modules/cp/cp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -27,4 +27,5 @@
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -84,5 +85,5 @@
 	int r = stat(path, &s);
 
-	if (r)
+	if (r != 0)
 		return TYPE_NONE;
 	else if (s.is_directory)
@@ -234,5 +235,5 @@
 			 */
 			if (force && !interactive) {
-				if (unlink(dest_path)) {
+				if (unlink(dest_path) != 0) {
 					printf("Unable to remove %s\n",
 					    dest_path);
@@ -245,5 +246,5 @@
 				if (overwrite) {
 					printf("Overwriting file: %s\n", dest_path);
-					if (unlink(dest_path)) {
+					if (unlink(dest_path) != 0) {
 						printf("Unable to remove %s\n", dest_path);
 						goto exit;
@@ -294,5 +295,5 @@
 				merge_paths(dest_path, PATH_MAX, src_dirname);
 
-				if (mkdir(dest_path, 0) == -1) {
+				if (mkdir(dest_path, 0) != 0) {
 					printf("Unable to create "
 					    "dest directory %s\n", dest_path);
@@ -308,5 +309,5 @@
 			 * e.g. cp -r /src /data/new_dir_src
 			 */
-			if (mkdir(dest_path, 0)) {
+			if (mkdir(dest_path, 0) != 0) {
 				printf("Unable to create "
 				    "dest directory %s\n", dest_path);
@@ -405,6 +406,6 @@
 	}
 
-	while ((bytes = read_all(fd1, buff, blen)) > 0) {
-		if ((bytes = write_all(fd2, buff, bytes)) < 0)
+	while ((bytes = read(fd1, buff, blen)) > 0) {
+		if ((bytes = write(fd2, buff, bytes)) < 0)
 			break;
 		copied += bytes;
@@ -412,5 +413,5 @@
 
 	if (bytes < 0) {
-		printf("\nError copying %s, (%d)\n", src, bytes);
+		printf("\nError copying %s, (%d)\n", src, errno);
 		copied = bytes;
 	}
Index: uspace/app/bdsh/cmds/modules/ls/ls.c
===================================================================
--- uspace/app/bdsh/cmds/modules/ls/ls.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/ls/ls.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -31,4 +31,5 @@
  * As more stuff is completed and exposed in libc, this will improve */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -187,5 +188,5 @@
 		if (rc != 0) {
 			printf("ls: skipping bogus node %s\n", buff);
-			printf("rc=%d\n", rc);
+			printf("error=%d\n", errno);
 			goto out;
 		}
@@ -314,5 +315,5 @@
 static unsigned int ls_scope(const char *path, struct dir_elem_t *de)
 {
-	if (stat(path, &de->s)) {
+	if (stat(path, &de->s) != 0) {
 		cli_error(CL_ENOENT, "%s", path);
 		return LS_BOGUS;
@@ -376,18 +377,23 @@
 		}
 	}
-	
+
 	argc -= optind;
-	
+
 	de.name = (char *) malloc(PATH_MAX);
 	if (!de.name) {
-		cli_error(CL_ENOMEM, "%s: ", cmdname);
+		cli_error(CL_ENOMEM, "%s: Out of memory", cmdname);
 		return CMD_FAILURE;
 	}
 	memset(de.name, 0, PATH_MAX);
-	
-	if (argc == 0)
-		getcwd(de.name, PATH_MAX);
-	else
+
+	if (argc == 0) {
+		if (getcwd(de.name, PATH_MAX) == NULL) {
+			cli_error(CL_EFAIL, "%s: Failed determining working "
+			    "directory", cmdname);
+			return CMD_FAILURE;
+		}
+	} else {
 		str_cpy(de.name, PATH_MAX, argv[optind]);
+	}
 
 	scope = ls_scope(de.name, &de);
Index: uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -89,5 +89,5 @@
 {
 	/* Ensure we would always work with absolute and canonified path. */
-	char *path = absolutize(user_path, NULL);
+	char *path = vfs_absolutize(user_path, NULL);
 	if (path == NULL) {
 		cli_error(CL_ENOMEM, "%s: path too big?", cmdname);
@@ -95,12 +95,10 @@
 	}
 
-	int rc;
 	int ret = 0;
 
 	if (!create_parents) {
-		rc = mkdir(path, 0);
-		if (rc != EOK) {
+		if (mkdir(path, 0) != 0) {
 			cli_error(CL_EFAIL, "%s: could not create %s (%s)",
-			    cmdname, path, str_error(rc));
+			    cmdname, path, str_error(errno));
 			ret = 1;
 		}
@@ -137,12 +135,8 @@
 			char slash_char = path[prev_off];
 			path[prev_off] = 0;
-			rc = mkdir(path, 0);
-			if (rc == EEXIST) {
-				rc = EOK;
-			}
-
-			if (rc != EOK) {
+
+			if (mkdir(path, 0) != 0 && errno != EEXIST) {
 				cli_error(CL_EFAIL, "%s: could not create %s (%s)",
-				    cmdname, path, str_error(rc));
+				    cmdname, path, str_error(errno));
 				ret = 1;
 				goto leave;
@@ -152,8 +146,7 @@
 		}
 		/* Create the final directory. */
-		rc = mkdir(path, 0);
-		if (rc != EOK) {
+		if (mkdir(path, 0) != 0) {
 			cli_error(CL_EFAIL, "%s: could not create %s (%s)",
-			    cmdname, path, str_error(rc));
+			    cmdname, path, str_error(errno));
 			ret = 1;
 		}
@@ -214,5 +207,6 @@
 
 	if (follow && (argv[optind] != NULL)) {
-		chdir(argv[optind]);
+		if (chdir(argv[optind]) != 0)
+			printf("%s: Error switching to directory.", cmdname);
 	}
 
Index: uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mkfile/mkfile.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/mkfile/mkfile.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -27,4 +27,5 @@
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -166,8 +167,10 @@
 
 		if ((rc2 = lseek(fd, file_size - 1, SEEK_SET)) < 0)
-			goto exit;
+			goto error;
 
 		rc2 = write(fd, &byte, sizeof(char));
-		goto exit;
+		if (rc2 < 0)
+			goto error;
+		return CMD_SUCCESS;
 	}
 
@@ -183,5 +186,5 @@
 		rc = write(fd, buffer, to_write);
 		if (rc <= 0) {
-			printf("%s: Error writing file (%zd).\n", cmdname, rc);
+			printf("%s: Error writing file (%d).\n", cmdname, errno);
 			close(fd);
 			return CMD_FAILURE;
@@ -191,12 +194,11 @@
 
 	free(buffer);
-exit:
-	rc = close(fd);
-
-	if (rc != 0 || rc2 < 0) {
-		printf("%s: Error writing file (%zd).\n", cmdname, rc);
-		return CMD_FAILURE;
-	}
+
+	if (close(fd) < 0)
+		goto error;
 
 	return CMD_SUCCESS;
+error:
+	printf("%s: Error writing file (%d).\n", cmdname, errno);
+	return CMD_FAILURE;
 }
Index: uspace/app/bdsh/cmds/modules/mount/mount.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mount/mount.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/mount/mount.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -72,5 +72,5 @@
 	int rc;
 
-	get_mtab_list(&mtab_list);
+	vfs_get_mtab_list(&mtab_list);
 
 	list_foreach(mtab_list, link, mtab_ent_t, mtab_ent) {
@@ -150,5 +150,5 @@
 		mopts = t_argv[4];
 
-	rc = mount(t_argv[1], t_argv[2], dev, mopts, 0, instance);
+	rc = vfs_mount(t_argv[1], t_argv[2], dev, mopts, 0, instance);
 	if (rc != EOK) {
 		printf("Unable to mount %s filesystem to %s on %s (rc=%d)\n",
Index: uspace/app/bdsh/cmds/modules/mv/mv.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mv/mv.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/mv/mv.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -60,7 +60,7 @@
 
 	rc = rename(argv[1], argv[2]);
-	if (rc != EOK) {
-		printf("Unable to rename %s to %s (rc=%d)\n",
-		    argv[1], argv[2], rc);
+	if (rc != 0) {
+		printf("Unable to rename %s to %s (error=%d)\n",
+		    argv[1], argv[2], errno);
 		return CMD_FAILURE;
 	}
Index: uspace/app/bdsh/cmds/modules/pwd/pwd.c
===================================================================
--- uspace/app/bdsh/cmds/modules/pwd/pwd.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/pwd/pwd.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -56,7 +56,6 @@
 
 	memset(buff, 0, PATH_MAX);
-	getcwd(buff, PATH_MAX);
 
-	if (! buff) {
+	if (getcwd(buff, PATH_MAX) == NULL) {
 		cli_error(CL_EFAIL,
 			"Unable to determine the current working directory");
Index: uspace/app/bdsh/cmds/modules/rm/rm.c
===================================================================
--- uspace/app/bdsh/cmds/modules/rm/rm.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/rm/rm.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -27,4 +27,5 @@
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -131,5 +132,5 @@
 static unsigned int rm_single(const char *path)
 {
-	if (unlink(path)) {
+	if (unlink(path) != 0) {
 		cli_error(CL_EFAIL, "rm: could not remove file %s", path);
 		return 1;
@@ -150,5 +151,5 @@
 
 	fd = open(path, O_RDONLY);
-	if (fd > 0) {
+	if (fd >= 0) {
 		close(fd);
 		return RM_FILE;
@@ -210,5 +211,5 @@
 	rc = rmdir(path);
 	if (rc == 0)
-		return ret;
+		return errno;
 
 	cli_error(CL_ENOTSUP, "Can not remove %s", path);
Index: uspace/app/bdsh/cmds/modules/touch/touch.c
===================================================================
--- uspace/app/bdsh/cmds/modules/touch/touch.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/touch/touch.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -123,5 +123,5 @@
 		
 		/* Check whether file exists if -c (--no-create) option is given */
-		if ((!no_create) || ((no_create) && (stat(buff, &file_stat) == EOK)))
+		if ((!no_create) || ((no_create) && (stat(buff, &file_stat) == 0)))
 			fd = open(buff, O_RDWR | O_CREAT);
 		
Index: uspace/app/bdsh/cmds/modules/unmount/unmount.c
===================================================================
--- uspace/app/bdsh/cmds/modules/unmount/unmount.c	(revision 193d280c34f38846eccfa1ecce71975f9ad92398)
+++ uspace/app/bdsh/cmds/modules/unmount/unmount.c	(revision 6afc9d780e775e54c1cfb5d3c57fb749979b18d2)
@@ -66,5 +66,5 @@
 	}
 
-	rc = unmount(argv[1]);
+	rc = vfs_unmount(argv[1]);
 	if (rc != EOK) {
 		printf("Unable to unmount %s (rc=%d)\n", argv[1], rc);
