0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 16:34:13 +01:00

ircd::fs: Make ~fd() noexcept.

This commit is contained in:
Jason Volk 2019-04-22 09:16:11 -07:00
parent 7d55468511
commit acd774c3ee
2 changed files with 11 additions and 2 deletions

View file

@ -45,7 +45,7 @@ struct ircd::fs::fd
fd(const fd &) = delete; fd(const fd &) = delete;
fd &operator=(fd &&) noexcept; fd &operator=(fd &&) noexcept;
fd &operator=(const fd &) = delete; fd &operator=(const fd &) = delete;
~fd() noexcept(false); ~fd() noexcept;
}; };
struct ircd::fs::fd::opts struct ircd::fs::fd::opts

View file

@ -1613,13 +1613,22 @@ noexcept
} }
ircd::fs::fd::~fd() ircd::fs::fd::~fd()
noexcept(false) noexcept try
{ {
if(fdno < 0) if(fdno < 0)
return; return;
syscall(::close, fdno); syscall(::close, fdno);
} }
catch(const std::exception &e)
{
log::critical
{
"Failed to close fd:%d :%s",
fdno,
e.what()
};
}
int int
ircd::fs::fd::release() ircd::fs::fd::release()