unix/PidFile: pass std::span to FileDescriptor::Read()

This commit is contained in:
Max Kellermann 2024-11-13 10:43:22 +01:00
parent 16604997d6
commit 263b9916c2

View File

@ -81,7 +81,7 @@ ReadPidFile(Path path) noexcept
pid_t pid = -1;
char buffer[32];
auto nbytes = fd.Read(buffer, sizeof(buffer) - 1);
auto nbytes = fd.Read(std::as_writable_bytes(std::span{buffer, sizeof(buffer) - 1}));
if (nbytes > 0) {
buffer[nbytes] = 0;