mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-10-09 04:01:01 +00:00
Revert the serial_recv() timeout handling as it used to be before my
yesterday's changes (i.e. before rev. 1.10 of ser_posix.c), that is, exit(1) in case of a timeout. Previously, the upper layers didn't see the timeout at all. Quite possible that some of these drivers could handle a timeout more intelligently though. At least for the rather sophisticated STK500v2 protocol, I think it should be possible to retry the request. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@460 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
11
stk500.c
11
stk500.c
@@ -63,7 +63,16 @@ static int stk500_send(PROGRAMMER * pgm, char * buf, size_t len)
|
||||
|
||||
static int stk500_recv(PROGRAMMER * pgm, char * buf, size_t len)
|
||||
{
|
||||
return serial_recv(pgm->fd, buf, len);
|
||||
int rv;
|
||||
|
||||
rv = serial_recv(pgm->fd, buf, len);
|
||||
if (rv < 0) {
|
||||
fprintf(stderr,
|
||||
"%s: stk500_recv(): programmer is not responding\n",
|
||||
progname);
|
||||
exit(1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user