survivor

graphical action game for the linux terminal
git clone https://git.ce9e.org/survivor.git

commit
555ffa987e25f7fa44582119f7778a9da1563bef
parent
d04291f51accf6743aaf2327ecbc6847cdefc89d
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-03-30 03:43
refactor: use SIGSTOP instead of resetting SIGTSTP handler

Diffstat

M src/main.rs 4 +---

1 files changed, 1 insertions, 3 deletions


diff --git a/src/main.rs b/src/main.rs

@@ -80,15 +80,13 @@ fn main() {
   80    80         if NEED_STOP.load(Ordering::Relaxed) {
   81    81             screen.restore();
   82    82             input.restore();
   83    -1             signal(libc::SIGTSTP, libc::SIG_DFL);
   84    83             unsafe {
   85    -1                 libc::kill(pid as libc::c_int, libc::SIGTSTP);
   -1    84                 libc::kill(pid as libc::c_int, libc::SIGSTOP);
   86    85             }
   87    86 
   88    87             // when SIGCONT is received
   89    88             screen.init();
   90    89             input.cbreak();
   91    -1             signal(libc::SIGTSTP, handle_signal as libc::sighandler_t);
   92    90             time0 = time::Instant::now();
   93    91             NEED_STOP.store(false, Ordering::Relaxed);
   94    92         }