While comment properly says that only first 64 bytes can be read, actual
code was returning error instead being happy with 64 bytes received.
Change-Id: I09c0d1d5c9fc8e1f6c59c093d81bb1ce1924281b
Signed-off-by: Damjan Marion <damarion@cisco.com>
/* You can only read more that 64 bytes of config space as root; so we try to
read the full space but fall back to just the first 64 bytes. */
- if (read (fd, &di->config_data, sizeof (di->config_data)) !=
- sizeof (di->config_data)
- && read (fd, &di->config0,
- sizeof (di->config0)) != sizeof (di->config0))
+ if (read (fd, &di->config_data, sizeof (di->config_data)) <
+ sizeof (di->config0))
{
err = clib_error_return_unix (0, "read `%s'", f);
close (fd);