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:
Richard Frith-Macdonald 2002-09-16 14:04:24 +00:00
parent 682ec1c5aa
commit 8453f2c2f8
2 changed files with 23 additions and 2 deletions

View file

@ -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",

View file

@ -165,7 +165,7 @@
@interface GSAttrDictionary : NSDictionary
{
#ifdef __MINGW__
const char *name;
char *name;
#endif
struct stat statbuf;
}
@ -2626,7 +2626,7 @@ static NSSet *fileKeys = nil;
{
#ifdef __MINGW__
if (name != 0)
NSZoneFree(name);
NSZoneFree(NSDefaultMallocZone(), name);
#endif
[super dealloc];
}