Include the file name to open and the fail error number

Also fix issues reported by nxstyle
This commit is contained in:
Alan Carvalho de Assis 2020-01-12 12:36:17 -03:00 committed by patacongo
parent 561fc02ae5
commit 921131895e

View File

@ -362,6 +362,7 @@ static void print_hex(uint8_t *data, int len)
}
}
}
printf("\n");
}
@ -483,7 +484,8 @@ int main(int argc, FAR char *argv[])
fd = open(DEV_NAME, O_RDWR);
if (fd < 0)
{
printf("ERROR: Failed to open device!\n");
int errcode = errno;
printf("ERROR: Failed to open device %s: %d\n", DEV_NAME, errcode);
goto errout;
}