mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Tidyups and fixes for windows.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14458 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
770c303403
commit
b4f8ea7fda
2 changed files with 23 additions and 2 deletions
|
@ -911,7 +911,28 @@ failure:
|
|||
IF_NO_GC(TEST_AUTORELEASE(att));
|
||||
}
|
||||
|
||||
#if defined(__NEW__MINGW__)
|
||||
if (ReplaceFile(theRealPath, thePath, 0,
|
||||
REPLACEFILE_IGNORE_MERGE_ERRORS, 0, 0) != 0)
|
||||
{
|
||||
c = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
c = -1;
|
||||
}
|
||||
#else
|
||||
c = rename(thePath, theRealPath);
|
||||
#if defined(__MINGW__)
|
||||
if (c != 0)
|
||||
{
|
||||
NSLog(@"Rename ('%s' to '%s') failed - %s trying delete first.",
|
||||
thePath, theRealPath, GSLastErrorStr(errno));
|
||||
DeleteFile(theRealPath); // Non-atomic!
|
||||
c = rename(thePath, theRealPath);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if (c != 0) /* Many things could go wrong, I guess. */
|
||||
{
|
||||
NSLog(@"Rename ('%s' to '%s') failed - %s",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue