Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6670e9cd authored by Daniel J Blueman's avatar Daniel J Blueman Committed by H. Peter Anvin
Browse files

x86, build: Make sure mkpiggy fails on read error



Ensure build doesn't silently continue despite read failure,
addressing a warning due to the unchecked call.

Signed-off-by: default avatarDaniel J Blueman <daniel.blueman@gmail.com>
LKML-Reference: <AANLkTimxxTMU3=4ry-_zbY6v1xiDi+hW9y1RegTr8vLK@mail.gmail.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent dd9c1549
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -62,7 +62,12 @@ int main(int argc, char *argv[])
	if (fseek(f, -4L, SEEK_END)) {
		perror(argv[1]);
	}
	fread(&olen, sizeof olen, 1, f);

	if (fread(&olen, sizeof(olen), 1, f) != 1) {
		perror(argv[1]);
		return 1;
	}

	ilen = ftell(f);
	olen = getle32(&olen);
	fclose(f);