From f7fb1db4a865fcec3fdb1433a828ecd991b98d7a Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Sat, 25 Apr 2020 18:13:53 +0200 Subject: [PATCH] fixed double close bug --- fdstream.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fdstream.cpp b/fdstream.cpp index ae1c30b..a12b7b4 100644 --- a/fdstream.cpp +++ b/fdstream.cpp @@ -16,6 +16,7 @@ sc::io::fdostream::~fdostream() { void sc::io::fdostream::close() { if (_outbuf.fd() != -1) { ::close(_outbuf.fd()); + _outbuf.fd(-1); } } @@ -26,6 +27,7 @@ sc::io::fdistream::~fdistream() { void sc::io::fdistream::close() { if (_inbuf.fd() != -1) { ::close(_inbuf.fd()); + _inbuf.fd(-1); } } @@ -36,5 +38,6 @@ sc::io::fdstream::~fdstream() { void sc::io::fdstream::close() { if (_iobuf.fd() != -1) { ::close(_iobuf.fd()); + _iobuf.fd(-1); } }