summary refs log tree commit diff
diff options
context:
space:
mode:
authorKlemens Nanni <klemens@posteo.de>2021-06-20 18:50:40 +0000
committerJune McEnroe <june@causal.agency>2021-06-21 18:11:09 -0400
commitb6cedf7dba67907200444aa7d54dea2065c7c210 (patch)
tree956366441d5776715beeb9c9ff66d5bbafa83343
parentHandle EINTR from connect(2) gracefully (diff)
downloadcatgirl-b6cedf7dba67907200444aa7d54dea2065c7c210.tar.gz
catgirl-b6cedf7dba67907200444aa7d54dea2065c7c210.zip
Register SIGWINCH handler before TLS connect
Otherwise resizing the terminal will end catgirl until a handler is
registered, e.g. while in ircConnect():

	catgirl: tls_handshake: (null)

Hoist registration right after uiInitEarly() as earliest possible point
in main() since initscr(3) sets up various signals incl. SIGWINCH, i.e.
initialise `cursesWinch' afterwards to pick up curses(3)'s handler.
Diffstat (limited to '')
-rw-r--r--chat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chat.c b/chat.c
index 479ec94..790038c 100644
--- a/chat.c
+++ b/chat.c
@@ -270,6 +270,7 @@ int main(int argc, char *argv[]) {
 	ircConfig(insecure, trust, cert, priv);
 
 	uiInitEarly();
+	sig_t cursesWinch = signal(SIGWINCH, signalHandler);
 	if (save) {
 		uiLoad(save);
 		atexit(exitSave);
@@ -324,7 +325,6 @@ int main(int argc, char *argv[]) {
 	signal(SIGALRM, signalHandler);
 	signal(SIGTERM, signalHandler);
 	signal(SIGCHLD, signalHandler);
-	sig_t cursesWinch = signal(SIGWINCH, signalHandler);
 
 	fcntl(irc, F_SETFD, FD_CLOEXEC);
 	bool pipes = !self.kiosk && !self.restricted;
August 29 picnic photosJune McEnroe 2024-09-08Apply some bold to trips renderingJune McEnroe 2024-09-08Render trips hopefully more efficientlyJune McEnroe 2024-09-08Allow removing bodies and lensesJune McEnroe 2024-09-08Limit body width so it looks less silly on desktopJune McEnroe 2024-09-07Handle no film being loadedJune McEnroe 2024-09-07Fancy up the text a littleJune McEnroe