@@ -23,14 +23,10 @@ #include #include #include #include -#ifdef HAVE_FCNTL_H -# include -#endif - #include "platform.h" #if !defined(OF_WINDOWS) && !defined(OF_MORPHOS) # include #endif @@ -1639,71 +1635,11 @@ return _blocking; } - (void)setBlocking: (bool)enable { -#ifdef HAVE_FCNTL - bool readImplemented = false, writeImplemented = false; - - @try { - int readFlags; - - readFlags = fcntl([self fileDescriptorForReading], F_GETFL); - - readImplemented = true; - - if (readFlags == -1) - @throw [OFSetOptionFailedException - exceptionWithStream: self - errNo: errno]; - - if (enable) - readFlags &= ~O_NONBLOCK; - else - readFlags |= O_NONBLOCK; - - if (fcntl([self fileDescriptorForReading], F_SETFL, - readFlags) == -1) - @throw [OFSetOptionFailedException - exceptionWithStream: self - errNo: errno]; - } @catch (OFNotImplementedException *e) { - } - - @try { - int writeFlags; - - writeFlags = fcntl([self fileDescriptorForWriting], F_GETFL); - - writeImplemented = true; - - if (writeFlags == -1) - @throw [OFSetOptionFailedException - exceptionWithStream: self - errNo: errno]; - - if (enable) - writeFlags &= ~O_NONBLOCK; - else - writeFlags |= O_NONBLOCK; - - if (fcntl([self fileDescriptorForWriting], F_SETFL, - writeFlags) == -1) - @throw [OFSetOptionFailedException - exceptionWithStream: self - errNo: errno]; - } @catch (OFNotImplementedException *e) { - } - - if (!readImplemented && !writeImplemented) - @throw [OFNotImplementedException exceptionWithSelector: _cmd - object: self]; - - _blocking = enable; -#else OF_UNRECOGNIZED_SELECTOR -#endif } - (int)fileDescriptorForReading { OF_UNRECOGNIZED_SELECTOR @@ -1748,8 +1684,7 @@ _writeBuffer = NULL; _writeBufferLength = 0; _writeBuffered = false; _waitingForDelimiter = false; - _blocking = false; } @end