io: add static dup method to fd
This commit is contained in:
parent
ce2f3b821b
commit
1b118ff377
12
io.cpp
12
io.cpp
@ -166,6 +166,18 @@ fd::~fd () {
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
fd
|
||||
fd::dup (int _fd)
|
||||
{
|
||||
auto res = ::dup (_fd);
|
||||
if (res < 0)
|
||||
errno_error::throw_code ();
|
||||
|
||||
return fd (res);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
int
|
||||
indenter::overflow (int ch) {
|
||||
|
Loading…
Reference in New Issue
Block a user