diff --git a/ChangeLog b/ChangeLog index 03b7a2be9..abf33630a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/Source/GSFileHandle.m b/Source/GSFileHandle.m index fe30db491..b513e2d58 100644 --- a/Source/GSFileHandle.m +++ b/Source/GSFileHandle.m @@ -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 {