Changeset 3b10e07b in mainline
- Timestamp:
- 2008-11-28T10:02:36Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c3c5640
- Parents:
- ee02922
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/cp/cp.c
ree02922 r3b10e07b 70 70 } 71 71 72 static size_t copy_file(const char *src, const char *dest, size_t blen, int vb)72 static int64_t copy_file(const char *src, const char *dest, size_t blen, int vb) 73 73 { 74 74 int fd1, fd2, bytes = 0; 75 75 off_t total = 0; 76 size_t copied = 0;76 int copied = -1; 77 77 char *buff = NULL; 78 78 … … 82 82 if (-1 == (fd1 = open(src, O_RDONLY))) { 83 83 printf("Unable to open source file %s\n", src); 84 return 0;84 return copied; 85 85 } 86 86 87 87 if (-1 == (fd2 = open(dest, O_CREAT))) { 88 88 printf("Unable to open destination file %s\n", dest); 89 return 0;89 return copied; 90 90 } 91 91 … … 112 112 if (bytes == -1) { 113 113 printf("Error copying %s\n", src); 114 copied = 0;114 copied = bytes; 115 115 goto out; 116 116 } … … 149 149 { 150 150 unsigned int argc, buffer = CP_DEFAULT_BUFLEN, verbose = 0; 151 int c, opt_ind, ret = 0; 151 int c, opt_ind; 152 int64_t ret; 152 153 153 154 argc = cli_count_args(argv);
Note:
See TracChangeset
for help on using the changeset viewer.