From 889f6a15061857fda1b16d396f615364db3e38e6 Mon Sep 17 00:00:00 2001 From: laforge Date: Tue, 13 Jun 2006 09:34:48 +0000 Subject: patch introduces -ETIMEDOUT as an error return code in case of 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 --- utils/librfid-tool.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'utils') diff --git a/utils/librfid-tool.c b/utils/librfid-tool.c index 8b7f58e..edb282b 100644 --- a/utils/librfid-tool.c +++ b/utils/librfid-tool.c @@ -17,6 +17,7 @@ #include #include #include +#include #define _GNU_SOURCE #include @@ -274,6 +275,8 @@ mifare_classic_read_sector(struct rfid_protocol_handle *ph, int sector) 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; -- cgit v1.2.3