Index: Source/GSFileHandle.m =================================================================== RCS file: /cvsroot/gnustep/gnustep/core/base/Source/GSFileHandle.m,v retrieving revision 1.7 diff -u -p -r1.7 GSFileHandle.m --- Source/GSFileHandle.m 22 Jan 2003 10:54:29 -0000 1.7 +++ Source/GSFileHandle.m 11 Feb 2003 16:27:04 -0000 @@ -1073,18 +1073,11 @@ NSString * const GSSOCKSRecvAddr = @"GSS self = [super init]; if (self != nil) { -#if defined(__MINGW__) - struct _stat sbuf; -#else +#ifndef __MINGW__ struct stat sbuf; int e; -#endif -#if defined(__MINGW__) - if (_fstat(desc, &sbuf) < 0) -#else if (fstat(desc, &sbuf) < 0) -#endif { NSLog(@"unable to get status of descriptor %d - %s", desc, GSLastErrorStr(errno)); @@ -1100,23 +1093,6 @@ NSString * const GSSOCKSRecvAddr = @"GSS isStandardFile = NO; } } - -#if defined(__MINGW__) - if (isStandardFile == NO) - { - unsigned long nbio = 0; - - isSocket = YES; - /* - * This is probably a socket ... try - * using a socket specific call and see if that fails. - */ - if (ioctlsocket(desc, FIONBIO, &nbio) == 0) - { - wasNonBlocking = (nbio == 0) ? NO : YES; - } - } -#else if ((e = fcntl(desc, F_GETFL, 0)) >= 0) { if (e & NBLK_OPT) @@ -1128,8 +1104,23 @@ NSString * const GSSOCKSRecvAddr = @"GSS wasNonBlocking = NO; } } -#endif +#else + unsigned long nbio = 0; + isSocket = YES; + /* + * This is probably a socket ... try + * using a socket specific call and see if that fails. + */ + if (ioctlsocket(desc, FIONBIO, &nbio) == 0) + { + isStandardFile = NO; + wasNonBlocking = (nbio == 0) ? NO : YES; + } + else + isStandardFile = YES; +#endif + isNonBlocking = wasNonBlocking; descriptor = desc; closeOnDealloc = flag;