summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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__