Skip to content

Commit 649e265

Browse files
committed
Fix nix::Error conversion
1 parent 8a65a61 commit 649e265

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/base/terminal.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,17 @@ impl<'a, T: Write + AsRawFd> Terminal<'a, T> {
8484
stop_and_cont.add(SIGTSTP);
8585

8686
// 1. Unblock SIGTSTP and SIGCONT, so that we actually stop when we receive another SIGTSTP
87-
pthread_sigmask(SigmaskHow::SIG_UNBLOCK, Some(&stop_and_cont), None)?;
87+
pthread_sigmask(SigmaskHow::SIG_UNBLOCK, Some(&stop_and_cont), None)
88+
.map_err(|e| e.as_errno().expect("Only expecting io errors"))?;
8889

8990
// 2. Reissue SIGTSTP (this time to whole the process group!)...
90-
killpg(getpgrp(), SIGTSTP)?;
91+
killpg(getpgrp(), SIGTSTP).map_err(|e| e.as_errno().expect("Only expecting io errors"))?;
9192
// ... and stop!
9293
// Now we are waiting for a SIGCONT.
9394

9495
// 3. Once we receive a SIGCONT we block SIGTSTP and SIGCONT again and resume.
95-
pthread_sigmask(SigmaskHow::SIG_BLOCK, Some(&stop_and_cont), None)?;
96+
pthread_sigmask(SigmaskHow::SIG_BLOCK, Some(&stop_and_cont), None)
97+
.map_err(|e| e.as_errno().expect("Only expecting io errors"))?;
9698

9799
self.enter_tui()
98100
}

0 commit comments

Comments
 (0)