From: <sk...@us...> - 2011-06-25 13:17:03
|
Revision: 2427 http://linuxconsole.svn.sourceforge.net/linuxconsole/?rev=2427&view=rev Author: skitt Date: 2011-06-25 13:16:57 +0000 (Sat, 25 Jun 2011) Log Message: ----------- Handle other retry errors correctly (thanks to Alexander Clouter for the patch). Release 1.4.1. Modified Paths: -------------- trunk/Makefile trunk/NEWS trunk/README trunk/utils/inputattach.c Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2011-06-25 13:14:12 UTC (rev 2426) +++ trunk/Makefile 2011-06-25 13:16:57 UTC (rev 2427) @@ -19,7 +19,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. -VERSION := 1.4 +VERSION := 1.4.1 PACKAGE := linuxconsoletools-$(VERSION) Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2011-06-25 13:14:12 UTC (rev 2426) +++ trunk/NEWS 2011-06-25 13:16:57 UTC (rev 2427) @@ -1,3 +1,9 @@ +Version 1.4.1 +------------- + +* inputattach correctly handles non-retry errors other than EINTR + (thanks to Alexander Clouter <al...@di...> for the patch). + Version 1.4 ----------- Modified: trunk/README =================================================================== --- trunk/README 2011-06-25 13:14:12 UTC (rev 2426) +++ trunk/README 2011-06-25 13:16:57 UTC (rev 2427) @@ -1,5 +1,5 @@ linuxconsole tools - Release 1.4 + Release 1.4.1 http://sf.net/projects/linuxconsole/ @@ -121,7 +121,7 @@ functions. * Claudio Nieder: Sahara Touch-iT213 support. * Florian Fainelli: evtest fixes. -* Alexander Clouter: W8001 support. +* Alexander Clouter: W8001 support and error-handling fixes. * Roberto Neri: much discussion, and fixes and improvements to jscal-store/jscal-restore and the udev rules given above. * Jean Delvare: inputattach improvements, TAOS support. Modified: trunk/utils/inputattach.c =================================================================== --- trunk/utils/inputattach.c 2011-06-25 13:14:12 UTC (rev 2426) +++ trunk/utils/inputattach.c 2011-06-25 13:16:57 UTC (rev 2427) @@ -607,6 +607,9 @@ puts(""); } +/* palmed wisdom from http://stackoverflow.com/questions/1674162/ */ +#define RETRY_ERROR(x) (x == EAGAIN || x == EWOULDBLOCK || x == EINTR) + int main(int argc, char **argv) { unsigned long devt; @@ -738,7 +741,13 @@ retval = EXIT_FAILURE; } - for (errno = 0; errno != EINTR; read(fd, NULL, 0)) ; + do { + i = read(fd, NULL, 0); + if (i == -1) { + if (RETRY_ERROR(errno)) + continue; + } + } while (!i); ldisc = 0; ioctl(fd, TIOCSETD, &ldisc); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |