Skip to content

Commit

Permalink
tools: Fix compile error with glibc
Browse files Browse the repository at this point in the history
This fixes the following compile error when compiling against recent
glibc:
------------
/tools/eeprom.c:223:9: error: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  223 |         fread(buf, 1, EEPROM_PART_SIZE, f);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
------------

Signed-off-by: Hauke Mehrtens <[email protected]>
  • Loading branch information
hauke authored and nbd168 committed Mar 2, 2023
1 parent c32d6d8 commit 021ded3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ static int
mt76_eeprom_changes(void)
{
unsigned char *buf;
size_t ret;
FILE *f;
int i;

Expand All @@ -220,7 +221,9 @@ mt76_eeprom_changes(void)

buf = malloc(EEPROM_PART_SIZE);
fseek(f, mtd_offset, SEEK_SET);
fread(buf, 1, EEPROM_PART_SIZE, f);
ret = fread(buf, 1, EEPROM_PART_SIZE, f);
if (ret != EEPROM_PART_SIZE)
return EXIT_FAILURE;
for (i = 0; i < EEPROM_PART_SIZE; i++) {
if (buf[i] == eeprom_data[i])
continue;
Expand Down

0 comments on commit 021ded3

Please sign in to comment.