file-copy.c revision fe363b433b8038a69b55169da9dca27892ad7d18
/* 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>
bool try_hardlink)
{
if (try_hardlink) {
/* see if hardlinking works */
return 1;
return -1;
}
return 1;
}
return 0;
return -1;
}
/* fallback to manual copying */
}
if (fd_in == -1) {
return 0;
return -1;
}
return -1;
}
if (fd_out == -1) {
return -1;
}
/* try to change the group, don't really care if it fails */
ret = -1;
}
ret = -1;
}
}
{
const char *tmppath;
int ret;
t_push();
if (ret > 0) {
ret = -1;
}
}
if (ret < 0)
t_pop();
return ret;
}