diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-10-30 01:55:25 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-10-30 01:55:25 +0100 |
commit | 2ab4648096c23d274c8f74997e271ca5cdcc6cac (patch) | |
tree | 8b4a94c836149d10e6fbb433c564c0ab22c4231a | |
parent | dd68df08748b9fd6c8e849e6403459d444a8fb5f (diff) |
Added SIGSTOP handling for suspending on ctrl-z
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | chatty.c | 7 |
2 files changed, 9 insertions, 0 deletions
@@ -22,6 +22,8 @@ The idea is the following: - [ ] timeout on recv? - [ ] use threads to handle clients/ timeout when receiving because a client could theoretically stall the entire server. +- [ ] do not crash on errors from clients + - implement error message? ## common - [x] handle messages that are too large @@ -471,6 +471,13 @@ main(int argc, char** argv) ninput--; } break; + case TB_KEY_CTRL_Z: { + pid_t pid = getpid(); + tb_shutdown(); + kill(pid, SIGSTOP); + tb_init(); + } break; + case TB_KEY_CTRL_D: case TB_KEY_CTRL_C: quit = 1; |