mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-24 15:15:39 -07:00
Add error handling
This commit is contained in:
parent
703a2c968a
commit
bd34794d26
1 changed files with 4 additions and 0 deletions
|
@ -509,6 +509,10 @@ int uart_receive(const serial_port sp, uint8_t *pbtRx, uint32_t pszMaxRxLen, uin
|
||||||
res = read(spu->fd, transitBuf, RingBuf_getAvailableSize(spu->udpBuffer));
|
res = read(spu->fd, transitBuf, RingBuf_getAvailableSize(spu->udpBuffer));
|
||||||
RingBuf_enqueueBatch(spu->udpBuffer, transitBuf, res);
|
RingBuf_enqueueBatch(spu->udpBuffer, transitBuf, res);
|
||||||
}
|
}
|
||||||
|
// Stop if the OS has some troubles reading the data
|
||||||
|
if (res < 0) {
|
||||||
|
return PM3_EIO;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue