X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Funix%2Fhandle.cpp;h=ea8fa4eeb9797e12f5a598f4c63d0fe6e352d492;hp=9546df9f579c657f61f658ee235db3e172eec7dd;hb=8e696b9c1ee35f2ce5b9264f31b1963758d65ced;hpb=9a4c531eb1aa68595cd3ab074b31bfa565aaefe2 diff --git a/source/io/unix/handle.cpp b/source/io/unix/handle.cpp index 9546df9..ea8fa4e 100644 --- a/source/io/unix/handle.cpp +++ b/source/io/unix/handle.cpp @@ -50,7 +50,11 @@ unsigned sys_write(Handle &handle, const char *buf, unsigned size) void sys_close(Handle &handle) { - close(*handle); + if(handle) + { + close(*handle); + *handle = INVALID_HANDLE_VALUE; + } } } // namespace IO