Add error handling

This commit is contained in:
wh201906 2023-10-16 21:12:14 +08:00
commit bd34794d26
No known key found for this signature in database

View file

@ -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));
RingBuf_enqueueBatch(spu->udpBuffer, transitBuf, res);
}
// Stop if the OS has some troubles reading the data
if (res < 0) {
return PM3_EIO;
}
continue;
}