mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd::fs: Make ~fd() noexcept.
This commit is contained in:
parent
7d55468511
commit
acd774c3ee
2 changed files with 11 additions and 2 deletions
|
@ -45,7 +45,7 @@ struct ircd::fs::fd
|
|||
fd(const fd &) = delete;
|
||||
fd &operator=(fd &&) noexcept;
|
||||
fd &operator=(const fd &) = delete;
|
||||
~fd() noexcept(false);
|
||||
~fd() noexcept;
|
||||
};
|
||||
|
||||
struct ircd::fs::fd::opts
|
||||
|
|
11
ircd/fs.cc
11
ircd/fs.cc
|
@ -1613,13 +1613,22 @@ noexcept
|
|||
}
|
||||
|
||||
ircd::fs::fd::~fd()
|
||||
noexcept(false)
|
||||
noexcept try
|
||||
{
|
||||
if(fdno < 0)
|
||||
return;
|
||||
|
||||
syscall(::close, fdno);
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::critical
|
||||
{
|
||||
"Failed to close fd:%d :%s",
|
||||
fdno,
|
||||
e.what()
|
||||
};
|
||||
}
|
||||
|
||||
int
|
||||
ircd::fs::fd::release()
|
||||
|
|
Loading…
Reference in a new issue