aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--handlekeys.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/handlekeys.c b/handlekeys.c
index 9ef3e76..5721341 100644
--- a/handlekeys.c
+++ b/handlekeys.c
@@ -180,7 +180,7 @@ static struct key keys[] =
180static volatile sig_atomic_t sigWinch; 180static volatile sig_atomic_t sigWinch;
181static int stillRunning; 181static int stillRunning;
182 182
183static void handleSignals(int signo) 183static void handleSIGWINCH(int signalNumber)
184{ 184{
185 sigWinch = 1; 185 sigWinch = 1;
186} 186}
@@ -190,7 +190,7 @@ static void handleSignals(int signo)
190void handle_keys(long extra, int (*handle_sequence)(long extra, char *sequence), void (*handle_CSI)(long extra, char *command, int *params, int count)) 190void handle_keys(long extra, int (*handle_sequence)(long extra, char *sequence), void (*handle_CSI)(long extra, char *command, int *params, int count))
191{ 191{
192 fd_set selectFds; 192 fd_set selectFds;
193 struct timespec timeout; 193 struct timespec timeOut;
194 struct sigaction sigAction, oldSigAction; 194 struct sigaction sigAction, oldSigAction;
195 sigset_t signalMask; 195 sigset_t signalMask;
196 char buffer[20], sequence[20]; 196 char buffer[20], sequence[20];
@@ -201,9 +201,9 @@ void handle_keys(long extra, int (*handle_sequence)(long extra, char *sequence),
201 201
202 // Terminals send the SIGWINCH signal when they resize. 202 // Terminals send the SIGWINCH signal when they resize.
203 memset(&sigAction, 0, sizeof(sigAction)); 203 memset(&sigAction, 0, sizeof(sigAction));
204 sigAction.sa_handler = handleSignals;
205 sigAction.sa_flags = SA_RESTART;// Useless if we are using poll. 204 sigAction.sa_flags = SA_RESTART;// Useless if we are using poll.
206 if (sigaction(SIGWINCH, &sigAction, &oldSigAction)) perror_exit("can't set signal handler SIGWINCH"); 205 if (sigaction(SIGWINCH, &sigAction, &oldSigAction)) perror_exit("can't set signal handler SIGWINCH");
206 sigAction.sa_handler = handleSIGWINCH;
207 sigemptyset(&signalMask); 207 sigemptyset(&signalMask);
208 sigaddset(&signalMask, SIGWINCH); 208 sigaddset(&signalMask, SIGWINCH);
209 209
@@ -216,7 +216,7 @@ void handle_keys(long extra, int (*handle_sequence)(long extra, char *sequence),
216 // Apparently it's more portable to reset these each time. 216 // Apparently it's more portable to reset these each time.
217 FD_ZERO(&selectFds); 217 FD_ZERO(&selectFds);
218 FD_SET(0, &selectFds); 218 FD_SET(0, &selectFds);
219 timeout.tv_sec = 0; timeout.tv_nsec = 100000000; // One tenth of a second. 219 timeOut.tv_sec = 0; timeOut.tv_nsec = 100000000; // One tenth of a second.
220 220
221// TODO - A bit unstable at the moment, something makes it go into a horrid CPU eating edit line flicker mode sometimes. And / or vi mode can crash on exit (stack smash). 221// TODO - A bit unstable at the moment, something makes it go into a horrid CPU eating edit line flicker mode sometimes. And / or vi mode can crash on exit (stack smash).
222// This might be fixed now. 222// This might be fixed now.