Fix warnings in coreboot utilities.
[coreboot.git] / util / nvramtool / cli / nvramtool.c
index 11a1a702afcf1a754330c9153efcd5e9986ee3bc..bcb10bbf34bce9ab47c124c0b7be14cffd076c17 100644 (file)
@@ -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);
                }