1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

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
parent dacec1a7ee
commit 6c549959c6

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);