Use alternate _DC_CopyFile() implementation on Windows

git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@721 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
gombasg 2006-06-20 12:58:50 +00:00 committed by Adam Visegradi
parent 411305cddc
commit 99f976459a
1 changed files with 15 additions and 1 deletions

View File

@ -5,11 +5,16 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
#include <dc_internal.h>
#include <dc_common.h>
@ -25,6 +30,14 @@
* Functions
*/
#ifdef _WIN32
int _DC_copyFile(const char *src, const char *dst)
{
if (CopyFile(src, dst, FALSE))
return 0;
return DC_ERR_SYSTEM;
}
#else
int _DC_copyFile(const char *src, const char *dst)
{
struct stat s;
@ -95,6 +108,7 @@ error:
errno = ret;
return DC_ERR_SYSTEM;
}
#endif /* _WIN32 */
long long _DC_processSuffix(const char *suffix)
{