libcsdbg  1.28
C++ exception (and generic) stack trace debug library
streambuf & csdbg::streambuf::close ( )
virtual

Close the stream.

Returns
*this

Definition at line 130 of file streambuf.cpp.

References likely, m_handle, and unlikely.

Referenced by csdbg::filebuf::open(), csdbg::tcpsockbuf::open(), csdbg::sttybuf::open(), operator=(), and ~streambuf().

131 {
132  if ( likely(m_handle >= 0) ) {
133  i32 retval;
134  do {
135  retval = ::close(m_handle);
136  }
137  while ( unlikely(retval < 0 && errno == EINTR) );
138 
139  m_handle = -1;
140  }
141 
142  return *this;
143 }
i32 m_handle
Stream handle (descriptor)
Definition: streambuf.hpp:43
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
Definition: config.hpp:344
int i32
32-bit signed integer
Definition: config.hpp:82
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349
virtual streambuf & close()
Close the stream.
Definition: streambuf.cpp:130

+ Here is the caller graph for this function: