]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/unix/handle.cpp
Fix mismatched fcntls in sys_set_blocking on unix
[libs/core.git] / source / io / unix / handle.cpp
index ea8fa4eeb9797e12f5a598f4c63d0fe6e352d492..cb3ce4cae54c16aae8ceb83194044aac98aca94c 100644 (file)
@@ -8,15 +8,9 @@
 namespace Msp {
 namespace IO {
 
-Handle::operator const void *() const
-{
-       return priv->handle!=-1 ? this : 0;
-}
-
-
 void sys_set_blocking(Handle &handle, bool b)
 {
-       int flags = fcntl(*handle, F_GETFD);
+       int flags = fcntl(*handle, F_GETFL);
        fcntl(*handle, F_SETFL, (flags&~O_NONBLOCK)|(b?0:O_NONBLOCK));
 }