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>
This commit is contained in:
Leah Rowe
2023-05-30 16:02:25 +01:00
parent 8df2f8095e
commit 83ecf26833
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ main(int argc, char *argv[])
{
int c;
#ifdef HAVE_PLEDGE
#ifdef __OpenBSD__
if (pledge("stdio", NULL) == -1)
err(errno, "pledge");
#endif