Revision: 7081 http://playerstage.svn.sourceforge.net/playerstage/?rev=7081&view=rev Author: thjc Date: 2008-10-07 11:30:41 +0000 (Tue, 07 Oct 2008)
Log Message: ----------- applied patch 2136981 khepera read() patch Modified Paths: -------------- code/player/trunk/server/drivers/mixed/khepera/khepera_serial.cc Modified: code/player/trunk/server/drivers/mixed/khepera/khepera_serial.cc =================================================================== --- code/player/trunk/server/drivers/mixed/khepera/khepera_serial.cc 2008-10-07 11:27:57 UTC (rev 7080) +++ code/player/trunk/server/drivers/mixed/khepera/khepera_serial.cc 2008-10-07 11:30:41 UTC (rev 7081) @@ -132,10 +132,14 @@ int TimePassed = 0; gettimeofday(&Start,NULL); int length = 0; + int rc = 0; do { pthread_testcancel(); - length += read(fd, &buffer[length], KHEPERA_BUFFER_LEN - length); + rc = read(fd, &buffer[length], KHEPERA_BUFFER_LEN - length); + if (rc < 0) + errno = rc = 0; + else length += rc; gettimeofday(&Now,NULL); TimePassed = (Now.tv_sec - Start.tv_sec)*1000000 + Now.tv_usec - Start.tv_usec; } while (buffer[length-1] != '\n' && TimePassed < KHEPERA_SERIAL_TIMEOUT_USECS); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit