Private
Public Access
2
0

aio.c: check aio_get_valid_fp return value

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-11-26 13:30:10 +00:00
parent bb5314efc1
commit a7b8d4a0ca

View File

@@ -121,7 +121,10 @@ mraa_aio_read(mraa_aio_context dev)
unsigned int shifter_value = 0;
if (dev->adc_in_fp == -1) {
aio_get_valid_fp(dev);
if (aio_get_valid_fp(dev) != MRAA_SUCCESS) {
syslog(LOG_ERR, "aio: Failed to get to the device");
return 0;
}
}
lseek(dev->adc_in_fp, 0, SEEK_SET);