disk_benchmark: Unbreak this utility now that read() of O_WRONLY fails

This commit is contained in:
Andreas Kling 2020-01-08 19:02:02 +01:00
commit 6c549959c6
Notes: sideshowbarker 2024-07-19 10:15:26 +09:00

View file

@ -116,11 +116,11 @@ int main(int argc, char** argv)
Result benchmark(const String& filename, int file_size, int block_size, ByteBuffer& buffer, bool allow_cache)
{
int flags = O_CREAT | O_TRUNC | O_WRONLY;
int flags = O_CREAT | O_TRUNC | O_RDWR;
if (!allow_cache)
flags |= O_DIRECT;
int fd = open(filename.characters(), flags);
int fd = open(filename.characters(), flags, 0644);
if (fd == -1) {
perror("open");
exit(1);