aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-07-17 02:55:20 -0400
committerJesse Luehrs <doy@tozt.net>2020-07-17 02:55:20 -0400
commit47f23f518e9b935943b5e71ccd0cbc978aff433f (patch)
tree5ea9dce43ed4dd755b1e5fe04005d127c078e68f
parent259a8abe9dd9b11c20445cdfda7eb9f481882b93 (diff)
downloadpty-process-47f23f518e9b935943b5e71ccd0cbc978aff433f.tar.gz
pty-process-47f23f518e9b935943b5e71ccd0cbc978aff433f.zip
fix a misconception in a comment
-rw-r--r--src/command.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/command.rs b/src/command.rs
index f7b1de8..3c46739 100644
--- a/src/command.rs
+++ b/src/command.rs
@@ -35,11 +35,9 @@ impl Command for std::process::Command {
.stdout(unsafe { std::process::Stdio::from_raw_fd(stdout) })
.stderr(unsafe { std::process::Stdio::from_raw_fd(stderr) });
- // XXX not entirely safe - setsid() and close() are async-signal-safe
- // functions, but ioctl() is not, and only async-signal-safe functions
- // are allowed to be called between fork() and exec(). other things
- // seem to be able to get away with this though, so i'm not sure what
- // the right answer here is?
+ // safe because setsid() and close() are async-signal-safe functions
+ // and ioctl() is a raw syscall (which is inherently
+ // async-signal-safe).
unsafe {
self.pre_exec(move || {
nix::unistd::setsid().map_err(|e| e.as_errno().unwrap())?;