diff options
author | Leah Rowe <leah@libreboot.org> | 2025-01-01 14:48:29 +0000 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-01-01 14:49:24 +0000 |
commit | 57971ceb227f45f8568a15a46bdee789eff20cf5 (patch) | |
tree | 0bf39a37997d5953a86f7fe31b81a89a1f17a4ee | |
parent | 15b37b2a1ab286c550a43276f238a09766e12049 (diff) |
util/nvmutil: Fix another straggler
I don't like using strings this way, it looks unclean.
Once again, use good old fashioned if/else.
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r-- | util/nvmutil/nvmutil.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index c7de5e0f..7f6b8782 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: MIT */ -/* SPDX-FileCopyrightText: 2022, 2023 Leah Rowe <leah@libreboot.org> */ +/* SPDX-FileCopyrightText: 2022, 2023, 2025 Leah Rowe <leah@libreboot.org> */ /* SPDX-FileCopyrightText: 2023 Riku Viitanen <riku.viitanen@protonmail.com> */ #include <sys/stat.h> @@ -76,10 +76,11 @@ main(int argc, char *argv[]) filename = argv[1]; #ifdef __OpenBSD__ err_if(unveil("/dev/urandom", "r") == -1); - err_if(unveil(filename, flags == O_RDONLY ? "r" : "rw") == -1); if (flags == O_RDONLY) { + err_if(unveil(filename, "r") == -1); err_if(pledge("stdio rpath", NULL) == -1); } else { + err_if(unveil(filename, "rw") == -1); err_if(pledge("stdio rpath wpath", NULL) == -1); } #endif |