summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-12-31 21:14:24 +0000
committerLeah Rowe <leah@libreboot.org>2024-12-31 21:14:24 +0000
commit15b37b2a1ab286c550a43276f238a09766e12049 (patch)
tree9a34b3b641dfc62cc7eba5ae48dacda4af743d65 /util/nvmutil/nvmutil.c
parente8799310db26df89720e8476a701f1904932234b (diff)
util/nvmutil: Tidy up pledge calls
I wasn't too happy using shorthand for strings like that. Tidy it up and use good old fashioned if/else. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r--util/nvmutil/nvmutil.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 35abbfae..c7de5e0f 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -77,8 +77,11 @@ main(int argc, char *argv[])
#ifdef __OpenBSD__
err_if(unveil("/dev/urandom", "r") == -1);
err_if(unveil(filename, flags == O_RDONLY ? "r" : "rw") == -1);
- err_if(pledge(flags == O_RDONLY ? "stdio rpath" : "stdio rpath wpath",
- NULL) == -1);
+ if (flags == O_RDONLY) {
+ err_if(pledge("stdio rpath", NULL) == -1);
+ } else {
+ err_if(pledge("stdio rpath wpath", NULL) == -1);
+ }
#endif
openFiles(filename);
#ifdef __OpenBSD__