diff options
Diffstat (limited to 'util/libreboot-utils/lottery.c')
| -rw-r--r-- | util/libreboot-utils/lottery.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/util/libreboot-utils/lottery.c b/util/libreboot-utils/lottery.c index 1648cbc7..3ac4d135 100644 --- a/util/libreboot-utils/lottery.c +++ b/util/libreboot-utils/lottery.c @@ -16,6 +16,9 @@ exit_cleanup(void); int main(int argc, char **argv) { +#ifndef __linux__ +#error This code is currently buggy on BSD systems. Only use on Linux. +#endif int same = 0; char *buf; size_t size = BUFSIZ; @@ -24,8 +27,11 @@ main(int argc, char **argv) (void) errhook(exit_cleanup); (void) lbsetprogname(argv[0]); +#ifdef __OpenBSD__ /* https://man.openbsd.org/pledge.2 */ - xpledgex("stdio", NULL); + if (pledge("stdio", NULL) == -1) + exitf("pledge"); +#endif buf = rmalloc(size); if (!vcmp(buf, buf + (size >> 1), size >> 1)) |
