diff --git a/src/system/EventFD.cxx b/src/system/EventFD.cxx index b3a7401..c567a14 100644 --- a/src/system/EventFD.cxx +++ b/src/system/EventFD.cxx @@ -3,6 +3,7 @@ #include "EventFD.hxx" #include "system/Error.hxx" +#include "util/SpanCast.hxx" #include @@ -31,5 +32,5 @@ EventFD::Write() noexcept static constexpr eventfd_t value = 1; [[maybe_unused]] ssize_t nbytes = - fd.Write(&value, sizeof(value)); + fd.Write(ReferenceAsBytes(value)); } diff --git a/src/system/SignalFD.cxx b/src/system/SignalFD.cxx index ba3c4d0..72d1da0 100644 --- a/src/system/SignalFD.cxx +++ b/src/system/SignalFD.cxx @@ -3,6 +3,7 @@ #include "SignalFD.hxx" #include "Error.hxx" +#include "util/SpanCast.hxx" #include @@ -28,7 +29,7 @@ SignalFD::Read() noexcept assert(fd.IsDefined()); signalfd_siginfo info; - return fd.Read(&info, sizeof(info)) > 0 + return fd.Read(ReferenceAsWritableBytes(info)) > 0 ? info.ssi_signo : -1; }