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>master
parent
e8799310db
commit
15b37b2a1a
|
@ -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__
|
||||
|
|
Loading…
Reference in New Issue