From a7b296d450c5d948b95c1342f726334b4e5a4c68 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 14 Nov 2011 12:40:34 -0800 Subject: Fix warnings in coreboot utilities. - Fix some poor programming practice (breaks of strict aliasing as well as not checking the return value of read) - Use PRIx64 instead of %llx to prevent compilation warnings with both 32bit and 64bit compilers - Use same compiler command options when linking inteltool and when detecting libpci for inteltool Change-Id: I08b2e8d1bbc908f6b1f26d25cb3a4b03d818e124 Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/752 Tested-by: build bot (Jenkins) Reviewed-by: Mathias Krause --- util/nvramtool/cli/nvramtool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'util/nvramtool/cli/nvramtool.c') diff --git a/util/nvramtool/cli/nvramtool.c b/util/nvramtool/cli/nvramtool.c index 11a1a702af..bcb10bbf34 100644 --- a/util/nvramtool/cli/nvramtool.c +++ b/util/nvramtool/cli/nvramtool.c @@ -143,7 +143,11 @@ int main(int argc, char *argv[]) if (fd_stat.st_size < 128) { lseek(fd, 127, SEEK_SET); - write(fd, "\0", 1); + if (write(fd, "\0", 1) != 1) { + fprintf(stderr, "Unable to extended '%s' to its full size.\n", + nvramtool_op_modifiers[NVRAMTOOL_MOD_USE_CMOS_FILE].param); + exit(1); + } fsync(fd); } -- cgit v1.2.3