Lots of defect fixes

This commit is contained in:
Raul Tambre 2015-10-17 20:47:18 +03:00
parent 5dfc22a604
commit fac9d74344
21 changed files with 341 additions and 95 deletions

View file

@ -327,7 +327,13 @@ int OSCopyFile(const char* source, const char* destination, bool overwrite)
//sendfile will work with non-socket output (i.e. regular file) on Linux 2.6.33+
off_t bytesCopied = 0;
struct stat fileinfo = { 0 };
fstat(input, &fileinfo);
s32 ret = fstat(input, &fileinfo);
if (ret < 0)
{
return -1;
}
int result = sendfile(output, input, &bytesCopied, fileinfo.st_size) == -1 ? -1 : 0;
#endif