diff options
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -998,6 +998,20 @@ impl Console } } +impl Drop for Console +{ + fn drop(&mut self) + { + if unsafe { libc::close(self.0) } == -1 { + eprintln!( + "Console: error closing fd {}: {}", + self.0, + Error::last_os_error() + ); + } + } +} + impl AsRawFd for Console { fn as_raw_fd(&self) -> RawFd { self.0 } |