summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-05-30 16:02:25 +0100
committerLeah Rowe <leah@libreboot.org>2023-05-30 16:02:25 +0100
commit83ecf2683382b11562ab4d4ec10c971b655950f2 (patch)
tree7fd116da3babc0ea7b0ae74234dce2ae71263f39 /util/nvmutil
parent8df2f8095e11aa4995906856bf3d9396890c6dd5 (diff)
util/*: Properly detect OpenBSD for pledge() call
The utils that are pledged checked HAVE_PLEDGE which was bogus. OpenBSD defines __OpenBSD__, which you can check for in ifdef. This change makes nvmutil and spkmodem-recv *actually* use pledge, when the utils are compiled on OpenBSD. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index a489dd8d..0eaa8f43 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -83,7 +83,7 @@ main(int argc, char *argv[])
void (*cmd)(void) = NULL;
const char *strMac = NULL, *strRMac = "??:??:??:??:??:??";
-#ifdef HAVE_PLEDGE /* openbsd */
+#ifdef __OpenBSD__
if (pledge("stdio wpath", NULL) == -1)
err(errno, "pledge");
#endif
@@ -96,7 +96,7 @@ main(int argc, char *argv[])
if (argc == 3) {
if (strcmp(COMMAND, "dump") == 0) {
-#ifdef HAVE_PLEDGE /* openbsd */
+#ifdef __OpenBSD__
if (pledge("stdio rpath", NULL) == -1)
err(errno, "pledge");
#endif