=== modified file 'termkey.c' --- termkey.c 2011-08-25 09:48:41 +0000 +++ termkey.c 2011-08-18 10:20:41 +0000 @@ -841,17 +841,12 @@ struct pollfd fd; -retry: fd.fd = tk->fd; fd.events = POLLIN; int pollret = poll(&fd, 1, tk->waittime); - if(pollret == -1) { - if(errno == EINTR && !(tk->flags & TERMKEY_FLAG_EINTR)) - goto retry; - + if(pollret == -1) return TERMKEY_RES_ERROR; - } if(fd.revents & (POLLIN|POLLHUP|POLLERR)) ret = termkey_advisereadable(tk); @@ -889,16 +884,11 @@ TermKeyResult termkey_advisereadable(TermKey *tk) { unsigned char buffer[64]; // Smaller than the default size - ssize_t len; - -retry: - len = read(tk->fd, buffer, sizeof buffer); + ssize_t len = read(tk->fd, buffer, sizeof buffer); if(len == -1) { if(errno == EAGAIN) return TERMKEY_RES_NONE; - else if(errno == EINTR && !(tk->flags & TERMKEY_FLAG_EINTR)) - goto retry; else return TERMKEY_RES_ERROR; } === modified file 'termkey.h.in' --- termkey.h.in 2011-08-25 09:48:41 +0000 +++ termkey.h.in 2011-08-18 10:20:41 +0000 @@ -145,8 +145,7 @@ TERMKEY_FLAG_UTF8 = 1 << 3, // Input is definitely UTF-8 TERMKEY_FLAG_NOTERMIOS = 1 << 4, // Do not make initial termios calls on construction TERMKEY_FLAG_SPACESYMBOL = 1 << 5, // Space is symbolic rather than Unicode - TERMKEY_FLAG_CTRLC = 1 << 6, // Allow Ctrl-C to be read as normal, disabling SIGINT - TERMKEY_FLAG_EINTR = 1 << 7 // Return ERROR on signal (EINTR) rather than retry + TERMKEY_FLAG_CTRLC = 1 << 6 // Allow Ctrl-C to be read as normal, disabling SIGINT }; void termkey_check_version(int major, int minor); === modified file 'termkey_advisereadable.3' --- termkey_advisereadable.3 2011-08-25 09:48:41 +0000 +++ termkey_advisereadable.3 2011-08-18 10:20:41 +0000 @@ -25,7 +25,7 @@ No nore bytes were read. .TP .B TERMKEY_RES_ERROR -An IO error occured. \fIerrno\fP will be preserved. If the error is \fBEINTR\fP then this will only be returned if \fBTERMKEY_FLAG_EINTR\fP flag is not set; if it is then the IO operation will be retried instead. +An IO error occured. \fIerrno\fP will be preserved. .SH "SEE ALSO" .BR termkey_new (3), .BR termkey_getkey (3), === modified file 'termkey_new.3' --- termkey_new.3 2011-08-25 09:48:41 +0000 +++ termkey_new.3 2011-04-03 17:44:48 +0000 @@ -42,9 +42,6 @@ .TP .B TERMKEY_FLAG_CTRLC Disable the \fBSIGINT\fP behaviour of \fICtrl-C\fP. If this flag is provided, then \fICtrl-C\fP will be available as a normal keypress, rather than sending the process group a \fBSIGINT\fP. This flag only takes effect without \fBTERMKEY_FLAG_NOTERMIOS\fP; with it, none of the signal keys are disabled anyway. -.TP -.B TERMKEY_FLAG_EINTR -Without this flag, IO operations are retried when interrupted by a signal (\fBEINTR\fP). With this flag the \fBTERMKEY_RES_ERROR\fP result is returned instead. .PP When the constructor is invoked, it attempts to detect if the current locale is UTF-8 aware or not, and sets either the \fBTERMKEY_FLAG_UTF8\fP or \fBTERMKEY_FLAG_RAW\fP flag. One of these two bits will always be in effect. The current flags in effect can be obtained by \fBtermkey_get_flags\fP(3). .SH VERSION CHECK MACRO === modified file 'termkey_waitkey.3.sh' --- termkey_waitkey.3.sh 2011-08-25 09:48:41 +0000 +++ termkey_waitkey.3.sh 2011-08-18 10:20:41 +0000 @@ -27,7 +27,7 @@ No key events are ready and the terminal has been closed, so no more will arrive. .TP .B TERMKEY_RES_ERROR -An IO error occured. \fIerrno\fP will be preserved. If the error is \fBEINTR\fP then this will only be returned if \fBTERMKEY_FLAG_EINTR\fP flag is not set; if it is then the IO operation will be retried instead. +An IO error occured. \fIerrno\fP will be preserved. .SH EXAMPLE The following example program prints details of every keypress until the user presses "Ctrl-C". .PP