diff --git a/src/io/FileDescriptor.cxx b/src/io/FileDescriptor.cxx index 08c38ca6c..5d326b1a0 100644 --- a/src/io/FileDescriptor.cxx +++ b/src/io/FileDescriptor.cxx @@ -267,7 +267,7 @@ void FileDescriptor::FullRead(std::span dest) const { while (!dest.empty()) { - ssize_t nbytes = Read(dest.data(), dest.size()); + ssize_t nbytes = Read(dest); if (nbytes <= 0) { if (nbytes < 0) throw MakeErrno("Failed to read"); @@ -282,7 +282,7 @@ void FileDescriptor::FullWrite(std::span src) const { while (!src.empty()) { - ssize_t nbytes = Write(src.data(), src.size()); + ssize_t nbytes = Write(src); if (nbytes <= 0) { if (nbytes < 0) throw MakeErrno("Failed to write"); diff --git a/src/io/FileDescriptor.hxx b/src/io/FileDescriptor.hxx index c132a4e9c..458cd8168 100644 --- a/src/io/FileDescriptor.hxx +++ b/src/io/FileDescriptor.hxx @@ -246,11 +246,6 @@ public: return ::read(fd, dest.data(), dest.size()); } - [[nodiscard]] - ssize_t Read(void *buffer, std::size_t length) const noexcept { - return ::read(fd, buffer, length); - } - /** * Read until all of the given buffer has been filled. Throws * on error. @@ -269,11 +264,6 @@ public: return ::write(fd, src.data(), src.size()); } - [[nodiscard]] - ssize_t Write(const void *buffer, std::size_t length) const noexcept { - return ::write(fd, buffer, length); - } - /** * Write until all of the given buffer has been written. * Throws on error. diff --git a/src/io/FileOutputStream.cxx b/src/io/FileOutputStream.cxx index d6df7985b..88386488f 100644 --- a/src/io/FileOutputStream.cxx +++ b/src/io/FileOutputStream.cxx @@ -250,7 +250,7 @@ FileOutputStream::Write(std::span src) { assert(IsDefined()); - ssize_t nbytes = fd.Write(src.data(), src.size()); + ssize_t nbytes = fd.Write(src); if (nbytes < 0) throw FmtErrno("Failed to write to {}", GetPath()); else if ((size_t)nbytes < src.size())