]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/windows/handle.cpp
Implement controls for file descriptor inheritance
[libs/core.git] / source / io / windows / handle.cpp
index 5b1d93368f3386adeab823b1c67c121a1cbd3264..e59de273a65ea07d3d42712f1d2394cdc0db018d 100644 (file)
@@ -5,13 +5,11 @@
 namespace Msp {
 namespace IO {
 
-Handle::operator const void *() const
+void sys_set_blocking(Handle &, bool)
 {
-       return priv->handle!=INVALID_HANDLE_VALUE ? this : 0;
 }
 
-
-void sys_set_blocking(Handle &, bool)
+void sys_set_inherit(Handle &, bool)
 {
 }
 
@@ -35,7 +33,11 @@ unsigned sys_write(Handle &handle, const char *buf, unsigned size)
 
 void sys_close(Handle &handle)
 {
-       CloseHandle(*handle);
+       if(handle)
+       {
+               CloseHandle(*handle);
+               *handle = INVALID_HANDLE_VALUE;
+       }
 }
 
 } // namespace IO