Index: uspace/app/bdsh/cmds/modules/cp/cp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cp/cp.c	(revision ee02922f7d62412ee64b3c5fd9b58e3ad972b3e2)
+++ uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 3b10e07b5a24e144e18c1c16fb9c3387c8a559a0)
@@ -70,9 +70,9 @@
 }
 
-static size_t copy_file(const char *src, const char *dest, size_t blen, int vb)
+static int64_t copy_file(const char *src, const char *dest, size_t blen, int vb)
 {
 	int fd1, fd2, bytes = 0;
 	off_t total = 0;
-	size_t copied = 0;
+	int copied = -1;
 	char *buff = NULL;
 
@@ -82,10 +82,10 @@
 	if (-1 == (fd1 = open(src, O_RDONLY))) {
 		printf("Unable to open source file %s\n", src);
-		return 0;
+		return copied;
 	}
 
 	if (-1 == (fd2 = open(dest, O_CREAT))) {
 		printf("Unable to open destination file %s\n", dest);
-		return 0;
+		return copied;
 	}
 
@@ -112,5 +112,5 @@
 	if (bytes == -1) {
 		printf("Error copying %s\n", src);
-		copied = 0;
+		copied = bytes;
 		goto out;
 	}
@@ -149,5 +149,6 @@
 {
 	unsigned int argc, buffer = CP_DEFAULT_BUFLEN, verbose = 0;
-	int c, opt_ind, ret = 0;
+	int c, opt_ind;
+	int64_t ret;
 
 	argc = cli_count_args(argv);
