Include the file name to open and the fail error number
Also fix issues reported by nxstyle
@@ -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;
}
