Skip to content

Commit

Permalink
Retry blocking writes.
Browse files Browse the repository at this point in the history
  • Loading branch information
benlaurie committed Sep 8, 2013
1 parent c37b9ae commit 1b46a38
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sw/airborne/boards/ardrone/navdata.c
Expand Up @@ -34,6 +34,7 @@
#include <unistd.h>
#include <string.h>
#include <math.h>
#include <errno.h>
#include "navdata.h"

#define NAVDATA_PACKET_SIZE 60
Expand Down Expand Up @@ -61,6 +62,8 @@ static void navdata_write(const uint8_t *buf, size_t count)
ssize_t n = write(nav_fd, buf + written, count - written);
if (n < 0)
{
if (errno == EAGAIN || errno == EWOULDBLOCK)
continue;
perror("navdata_write: Write failed");
// FIXME: what's sensible to do at this point?
return;
Expand Down

0 comments on commit 1b46a38

Please sign in to comment.