From 14e75ed721dc4505aaca176d7ce893ba6b58f339 Mon Sep 17 00:00:00 2001
From: Pankaj Raghav
Date: Thu, 30 Mar 2023 14:06:19 +0200
Subject: [PATCH] disk_benchmark: Remove the call to umask
Calling umask and open with same permission value will result in a file
with no permissions bits if the program is stopped while it is doing an
IO. This will result in an error with EACCES when we try to run the
benchmark with the same file name. The file needs to be manually
removed before continuing the benchmark.
There is no use in calling umask here, so just remove it so that
interrupting the program while it is doing an IO will not result int the
file with no permissions the next time we run the program.
---
Userland/Utilities/disk_benchmark.cpp | 2 --
1 file changed, 2 deletions(-)
diff --git a/Userland/Utilities/disk_benchmark.cpp b/Userland/Utilities/disk_benchmark.cpp
index 70abbf18f2..e6a375f74d 100644
--- a/Userland/Utilities/disk_benchmark.cpp
+++ b/Userland/Utilities/disk_benchmark.cpp
@@ -68,8 +68,6 @@ ErrorOr serenity_main(Main::Arguments arguments)
block_sizes = { 8192, 32768, 65536 };
}
- umask(0644);
-
auto filename = DeprecatedString::formatted("{}/disk_benchmark.tmp", directory);
for (auto file_size : file_sizes) {