summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-05 16:51:26 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-05 16:51:26 -0500
commitc86400ecb67614846eae2d4bf47f71f50263100a (patch)
tree5444882ca4d1ab113082656af73db4568c54c831 /src
parentd22732d1c3f4629f81f8fe0212dcc06df40be81f (diff)
downloadnbsh-c86400ecb67614846eae2d4bf47f71f50263100a.tar.gz
nbsh-c86400ecb67614846eae2d4bf47f71f50263100a.zip
safety comments
Diffstat (limited to 'src')
-rw-r--r--src/pipeline/command.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pipeline/command.rs b/src/pipeline/command.rs
index 3a898d1..2c49cd3 100644
--- a/src/pipeline/command.rs
+++ b/src/pipeline/command.rs
@@ -125,6 +125,8 @@ impl Command {
);
match inner {
Inner::Binary(mut cmd) => {
+ // Safety: open, dup2, and close are async-signal-safe
+ // functions
unsafe { cmd.pre_exec(pre_exec) };
Ok(Child::Binary(cmd.spawn().map_err(|e| {
anyhow::anyhow!(
@@ -135,6 +137,8 @@ impl Command {
})?))
}
Inner::Builtin(mut cmd) => {
+ // Safety: open, dup2, and close are async-signal-safe
+ // functions
unsafe { cmd.pre_exec(pre_exec) };
Ok(Child::Builtin(cmd.spawn(env)?))
}