rpn(1): adds null unveil
This commit is contained in:
parent
06384c72fb
commit
b946469da5
@ -60,7 +60,7 @@ use sysexits::{ EX_DATAERR, EX_IOERR };
|
|||||||
#[cfg(target_os="openbsd")] extern crate strerror;
|
#[cfg(target_os="openbsd")] extern crate strerror;
|
||||||
#[cfg(target_os="openbsd")] extern crate openbsd;
|
#[cfg(target_os="openbsd")] extern crate openbsd;
|
||||||
#[cfg(target_os="openbsd")] use strerror::StrError;
|
#[cfg(target_os="openbsd")] use strerror::StrError;
|
||||||
#[cfg(target_os="openbsd")] use openbsd::{ Promises, pledge };
|
#[cfg(target_os="openbsd")] use openbsd::{ Promises, pledge, unveil };
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, PartialOrd, Debug)]
|
#[derive(Clone, PartialEq, PartialOrd, Debug)]
|
||||||
/* enum CalcType is a type containing operations used in the calculator */
|
/* enum CalcType is a type containing operations used in the calculator */
|
||||||
@ -225,10 +225,14 @@ fn main() -> ExitCode {
|
|||||||
let argv = args().collect::<Vec<String>>();
|
let argv = args().collect::<Vec<String>>();
|
||||||
|
|
||||||
#[cfg(target_os="openbsd")] {
|
#[cfg(target_os="openbsd")] {
|
||||||
let promises = Promises::new("stdio");
|
let promises = Promises::new("stdio unveil");
|
||||||
if let Err(e) = pledge(Some(promises), None) {
|
if let Err(e) = pledge(Some(promises), None) {
|
||||||
return err(&argv[0], &e, Some(EX_OSERR));
|
return err(&argv[0], &e, Some(EX_OSERR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Err(e) = unveil(None, None) {
|
||||||
|
return err(&argv[0], &e, Some(EX_OSERR));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut stack = VecDeque::new();
|
let mut stack = VecDeque::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user