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:
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(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
|
||||||
|
|
11
ircd/fs.cc
11
ircd/fs.cc
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue