io/UniqueFileDescriptor: use AdoptTag in the constructors that adopt ownership
This commit is contained in:
committed by
Max Kellermann
parent
765a6a2f20
commit
35dc1fc589
@@ -5,7 +5,7 @@
|
||||
#include "Error.hxx"
|
||||
|
||||
EpollFD::EpollFD()
|
||||
:fd(::epoll_create1(EPOLL_CLOEXEC))
|
||||
:fd(AdoptTag{}, ::epoll_create1(EPOLL_CLOEXEC))
|
||||
{
|
||||
if (!fd.IsDefined())
|
||||
throw MakeErrno("epoll_create1() failed");
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <sys/eventfd.h>
|
||||
|
||||
EventFD::EventFD()
|
||||
:fd(::eventfd(0, EFD_NONBLOCK|EFD_CLOEXEC))
|
||||
:fd(AdoptTag{}, ::eventfd(0, EFD_NONBLOCK|EFD_CLOEXEC))
|
||||
{
|
||||
if (!fd.IsDefined())
|
||||
throw MakeErrno("eventfd() failed");
|
||||
|
||||
@@ -17,7 +17,7 @@ SignalFD::Create(const sigset_t &mask)
|
||||
throw MakeErrno("signalfd() failed");
|
||||
|
||||
if (!fd.IsDefined()) {
|
||||
fd = UniqueFileDescriptor{new_fd};
|
||||
fd = UniqueFileDescriptor{AdoptTag{}, new_fd};
|
||||
}
|
||||
|
||||
assert(new_fd == fd.Get());
|
||||
|
||||
Reference in New Issue
Block a user