timeout. (For *_close it's important to distinguish between 'real'
errors and timeout.) (Henryk Ploetz)
git-svn-id: https://svn.gnumonks.org/trunk/librfid@1815
e0336214-984f-0b4b-a45f-
81c69e1f0ede
/* Abort after some timeout */
if (cycles > timeout*10/USLEEP_PER_CYCLE) {
- fprintf(stderr, "TIMEOUT!!\n");
- return -1;
+ return -ETIMEDOUT;
}
cycles++;
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <errno.h>
#define _GNU_SOURCE
#include <getopt.h>
for (block = sector*4; block < sector*4+4; block++) {
printf("reading block %u\n", block);
ret = rfid_protocol_read(ph, block, buf, &len);
+ if(ret == -ETIMEDOUT)
+ fprintf(stderr, "TIMEOUT\n");
if (ret < 0)
return ret;