logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0002-Only-send-SIGHUP-on-close-when-using-PTY.patch (769B)


  1. From 6ee6144c159551d45f0e02a87b5635c29e48fbbf Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 22 Feb 2020 17:17:01 -0800
  4. Subject: [PATCH] Only send SIGHUP on close when using PTY
  5. Otherwise, pid is at its default value (0), so SIGHUP gets sent to
  6. the entire process group.
  7. ---
  8. st.c | 6 ++++--
  9. 1 file changed, 4 insertions(+), 2 deletions(-)
  10. diff --git a/st.c b/st.c
  11. index 913c71b..20a3c3c 100644
  12. --- a/st.c
  13. +++ b/st.c
  14. @@ -4325,8 +4325,10 @@ toplevelconfigure(void *data, struct xdg_toplevel *toplevel, int32_t w, int32_t
  15. void
  16. toplevelclose(void *data, struct xdg_toplevel *toplevel)
  17. {
  18. - /* Send SIGHUP to shell */
  19. - kill(pid, SIGHUP);
  20. + if (pid) {
  21. + /* Send SIGHUP to shell */
  22. + kill(pid, SIGHUP);
  23. + }
  24. exit(0);
  25. }
  26. --
  27. 2.37.3