@@ -129,6 +129,7 @@ int copyfile(const char *src, const char *dst)
{
int fd_src = -1, fd_dst = -1;
void *buf = NULL;
+ const size_t bufsize = 64 * 1024;
ssize_t size;
size_t count;
int ret = -1;
@@ -145,14 +146,14 @@ int copyfile(const char *src, const char *dst)
goto out;
}
- buf = calloc(1, 512);
+ buf = calloc(1, bufsize);
if (!buf) {
printf("Can't allocate buffer to copy file\n");
goto out;
}
while (1) {
- size = read(fd_src, buf, 512);
+ size = read(fd_src, buf, bufsize);
if (size < 0) {
printf("Can't read file %s\n", src);
goto out;