io/FileDescriptor: pass std::span to Full{Read,Write}()

This commit is contained in:
Max Kellermann
2023-09-26 20:40:05 +02:00
committed by Max Kellermann
parent 9a0b3775d8
commit 09a2da89a2
6 changed files with 18 additions and 23 deletions

View File

@@ -170,13 +170,13 @@ dump_input_stream(InputStream &is, FileDescriptor out,
}
}
char buffer[MAX_CHUNK_SIZE];
std::byte buffer[MAX_CHUNK_SIZE];
assert(chunk_size <= sizeof(buffer));
size_t num_read = is.Read(lock, buffer, chunk_size);
if (num_read == 0)
break;
out.FullWrite(buffer, num_read);
out.FullWrite({buffer, num_read});
}
is.Check();