about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-01-03 01:45:26 +0100
committerbptato <nincsnevem662@gmail.com>2024-01-03 01:50:40 +0100
commitae3c255a6a03224464cdc5f24eff8428147a7e7d (patch)
tree2429e012ae976ad77f03542ecdd70695bdb7b6cc
parent82fdf7df545442182c1cf0298a7629f8acf0532d (diff)
downloadchawan-ae3c255a6a03224464cdc5f24eff8428147a7e7d.tar.gz
buffer: do not trap SIGINT to cleanup
We trap SIGINT with setControlCHook to avoid buffers being killed by
the process group receiving a SIGINT; trapping it to cleanup has the
opposite effect. SIGTERM should be enough, as that is what we use for
cleaning up buffers.
-rw-r--r--src/server/buffer.nim2
-rw-r--r--src/server/forkserver.nim2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index 02abb267..063dfb7a 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -1816,7 +1816,7 @@ proc launchBuffer*(config: BufferConfig, source: BufferSource,
     ssock: ssock
   )
   gbuffer = buffer
-  onSignal SIGTERM, SIGINT:
+  onSignal SIGTERM:
     discard sig
     gbuffer.cleanup()
   buffer.srenderer = newStreamRenderer(buffer.sstream, buffer.charsets)
diff --git a/src/server/forkserver.nim b/src/server/forkserver.nim
index 13eb2936..6caf742f 100644
--- a/src/server/forkserver.nim
+++ b/src/server/forkserver.nim
@@ -127,7 +127,7 @@ proc forkBuffer(ctx: var ForkServerContext): Pid =
     discard close(pipefd[0]) # close read
     let ssock = initServerSocket(buffered = false)
     gssock = ssock
-    onSignal SIGTERM, SIGINT:
+    onSignal SIGTERM:
       # This will be overridden after buffer has been set up; it is only
       # necessary to avoid a race condition when buffer is killed before that.
       discard sig