intel_de3815.c: check i2c device fd
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -129,6 +129,9 @@ mraa_intel_de3815()
|
|||||||
char path[MAX_SIZE];
|
char path[MAX_SIZE];
|
||||||
snprintf(path, MAX_SIZE, "/sys/class/i2c-dev/i2c-%u/name", i);
|
snprintf(path, MAX_SIZE, "/sys/class/i2c-dev/i2c-%u/name", i);
|
||||||
fd = open(path, O_RDONLY);
|
fd = open(path, O_RDONLY);
|
||||||
|
if (fd < 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
off_t size = lseek(fd, 0, SEEK_END);
|
off_t size = lseek(fd, 0, SEEK_END);
|
||||||
char value[MAX_SIZE];
|
char value[MAX_SIZE];
|
||||||
lseek(fd, 0, SEEK_SET);
|
lseek(fd, 0, SEEK_SET);
|
||||||
|
|||||||
Reference in New Issue
Block a user