int
copy_file(const char *src, const char *dest, int compress_dest)
{
- int fd_in = -1, fd_out = -1;
+ int fd_in, fd_out;
gzFile gz_in = NULL, gz_out = NULL;
char buf[10240];
int n, written;
long maxlen = path_max(path);
ssize_t len;
char *buf;
-#ifdef PATH_MAX
- maxlen = PATH_MAX;
-#elif defined(MAXPATHLEN)
- maxlen = MAXPATHLEN;
-#elif defined(_PC_PATH_MAX)
- maxlen = pathconf(path, _PC_PATH_MAX);
-#endif
if (maxlen < 4096) maxlen = 4096;
buf = x_malloc(maxlen);
}
allocated = size_hint;
*data = x_malloc(allocated);
- ret = 0;
while (true) {
if (pos > allocated / 2) {
allocated *= 2;