Windows tweak suggested by Riccardo Mottola

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28357 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-06-17 10:35:49 +00:00
parent 0007b42900
commit 940c602e67
2 changed files with 14 additions and 0 deletions

View file

@ -3,6 +3,8 @@
* Source/win32/NSMessagePort.m: Don't use NSLog() to report error
when writing to mailslot ... it's usually just that the remote
end has terminated, so invalidating the port silently is better.
* Source/GSFileHandle.m: Adjust code to deal with fstat() returning
a failure on windows if the descriptor is a pipe/socket.
2009-06-13 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -1096,8 +1096,20 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
if (fstat(desc, &sbuf) < 0)
{
#if defined(__MINGW32__)
/* On windows, an fstat will fail if the descriptor is a pipe
* or socket, so we simply mark the descriptor as not being a
* standard file.
*/
isStandardFile = NO;
#else
/* This should never happen on unix. If it does, we have somehow
* ended up with a bad descriptor.
*/
NSLog(@"unable to get status of descriptor %d - %@",
desc, [NSError _last]);
isStandardFile = NO;
#endif
}
else
{