Private
Public Access
2
0

intel_de3815.c: check i2c device fd

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2015-07-08 09:39:52 +01:00
parent 5131349c4d
commit f9dd4c06de

View File

@@ -129,6 +129,9 @@ mraa_intel_de3815()
char path[MAX_SIZE];
snprintf(path, MAX_SIZE, "/sys/class/i2c-dev/i2c-%u/name", i);
fd = open(path, O_RDONLY);
if (fd < 0) {
break;
}
off_t size = lseek(fd, 0, SEEK_END);
char value[MAX_SIZE];
lseek(fd, 0, SEEK_SET);