Skip to content

Commit

Permalink
Make pledge() less strict about the API
Browse files Browse the repository at this point in the history
We were previously returning EINVAL but OpenBSD allows it.
  • Loading branch information
jart committed Oct 4, 2023
1 parent 695f740 commit 4825737
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc/calls/pledge.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@
int pledge(const char *promises, const char *execpromises) {
int e, rc;
unsigned long ipromises, iexecpromises;
if (promises && !execpromises) {
execpromises = promises;
}
if (!promises) {
// OpenBSD says NULL argument means it doesn't change, i.e.
// pledge(0,0) on OpenBSD does nothing. The Cosmopolitan Libc
Expand Down

0 comments on commit 4825737

Please sign in to comment.