file-copy.c revision b978e532c217b51d398d1855893143b7bc0a73f3
/* Copyright (c) 2006 Timo Sirainen */
#include "lib.h"
#include "istream.h"
#include "ostream.h"
#include "file-copy.h"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
{
const char *tmppath;
if (try_hardlink) {
/* see if hardlinking works */
return 1;
return 0;
return -1;
}
/* fallback to manual copying */
}
if (fd_in == -1) {
return 0;
return -1;
}
t_push();
if (fd_out == -1) {
t_pop();
return -1;
}
ret = -1;
}
ret = -1;
}
if (ret == 0) {
ret = -1;
}
}
if (ret < 0)
t_pop();
}