diff --git a/src/system/EventFD.cxx b/src/system/EventFD.cxx index b3a740165..c567a141e 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 ba3c4d058..72d1da05a 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; }