summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorNicholas Cellino <nacellin@buffalo.edu>2022-03-21 21:13:47 -0400
committerAndreas Kling <kling@serenityos.org>2022-03-22 11:51:32 +0100
commit1db7c423db6a2f90bf86d79fd2d533a155aecb0d (patch)
treef9097bf9939ecc0bdb466941b9a7e83783ba8a8e /Userland
parent0a9e84aff00ada432d58515a68b261bff23ea591 (diff)
downloadserenity-1db7c423db6a2f90bf86d79fd2d533a155aecb0d.zip
disk_benchmark: Port to LibMain
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Utilities/CMakeLists.txt1
-rw-r--r--Userland/Utilities/disk_benchmark.cpp5
2 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt
index 210ea95209..348c0f7721 100644
--- a/Userland/Utilities/CMakeLists.txt
+++ b/Userland/Utilities/CMakeLists.txt
@@ -90,6 +90,7 @@ target_link_libraries(df LibMain)
target_link_libraries(diff LibDiff LibMain)
target_link_libraries(dirname LibMain)
target_link_libraries(disasm LibX86 LibMain)
+target_link_libraries(disk_benchmark LibMain)
target_link_libraries(dmesg LibMain)
target_link_libraries(du LibMain)
target_link_libraries(echo LibMain)
diff --git a/Userland/Utilities/disk_benchmark.cpp b/Userland/Utilities/disk_benchmark.cpp
index 551be5a491..3d2b8d674a 100644
--- a/Userland/Utilities/disk_benchmark.cpp
+++ b/Userland/Utilities/disk_benchmark.cpp
@@ -10,6 +10,7 @@
#include <AK/Types.h>
#include <AK/Vector.h>
#include <LibCore/ElapsedTimer.h>
+#include <LibMain/Main.h>
#include <fcntl.h>
#include <getopt.h>
#include <stdio.h>
@@ -45,7 +46,7 @@ static void exit_with_usage(int rc)
static Optional<Result> benchmark(const String& filename, int file_size, int block_size, ByteBuffer& buffer, bool allow_cache);
-int main(int argc, char** argv)
+ErrorOr<int> serenity_main(Main::Arguments arguments)
{
String directory = ".";
int time_per_benchmark = 10;
@@ -54,7 +55,7 @@ int main(int argc, char** argv)
bool allow_cache = false;
int opt;
- while ((opt = getopt(argc, argv, "chd:t:f:b:")) != -1) {
+ while ((opt = getopt(arguments.argc, arguments.argv, "chd:t:f:b:")) != -1) {
switch (opt) {
case 'h':
exit_with_usage(0);