Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4669 → Rev 3675

/branches/tracing/uspace/app/bdsh/cmds/modules/cp/cp.c
34,6 → 34,7
#include <getopt.h>
#include <string.h>
#include <fcntl.h>
#include <assert.h>
#include "config.h"
#include "util.h"
#include "errors.h"
69,8 → 70,7
return (int) t1;
}
 
static int64_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;
124,19 → 124,12
goto err;
res -= bytes;
} while (res > 0);
 
/* TODO: re-insert assert() once this is stand alone,
* removed as abort() exits the entire shell
*/
if (res != 0) {
printf("\n%d more bytes than actually exist were copied\n", res);
goto err;
}
assert(res == 0);
}
 
if (bytes < 0) {
err:
printf("\nError copying %s, (%d)\n", src, bytes);
printf("Error copying %s, (%d)\n", src, bytes);
copied = bytes;
}
 
/branches/tracing/uspace/app/bdsh/cmds/modules/cp/cp_def.h
3,5 → 3,6
"Copy files and directories",
&cmd_cp,
&help_cmd_cp,
0
},