mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
CopyFile fixed
This commit is contained in:
parent
f8ad9d13f8
commit
f8c64b1fb4
1 changed files with 2 additions and 2 deletions
|
@ -163,7 +163,7 @@ int OSCopyFile(const char* source, const char* destination, bool overwrite)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ((output = open(destination, O_RDWR | O_CREAT | (overwrite ? 0 : O_EXCL)), S_IRUSR | S_IWUSR) == -1)
|
if ((output = open(destination, O_RDWR | O_CREAT | (overwrite ? 0 : O_EXCL)), 0666) == -1)
|
||||||
{
|
{
|
||||||
close(input);
|
close(input);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -178,7 +178,7 @@ int OSCopyFile(const char* source, const char* destination, bool overwrite)
|
||||||
off_t bytesCopied = 0;
|
off_t bytesCopied = 0;
|
||||||
struct stat fileinfo = { 0 };
|
struct stat fileinfo = { 0 };
|
||||||
fstat(input, &fileinfo);
|
fstat(input, &fileinfo);
|
||||||
int result = sendfile(output, input, &bytesCopied, fileinfo.st_size);
|
int result = sendfile(output, input, &bytesCopied, fileinfo.st_size) == -1 ? -1 : 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
close(input);
|
close(input);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue