grub/include/grub/emu
Colin Watson 62daa27056 util: Detect more I/O errors
Many of GRUB's utilities don't check anywhere near all the possible
write errors.  For example, if grub-install runs out of space when
copying a file, it won't notice.  There were missing checks for the
return values of write, fflush, fsync, and close (or the equivalents on
other OSes), all of which must be checked.

I tried to be consistent with the existing logging practices of the
various hostdisk implementations, but they weren't entirely consistent
to start with so I used my judgement.  The result at least looks
reasonable on GNU/Linux when I provoke a write error:

  Installing for x86_64-efi platform.
  grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/debian/grubx64.efi': No space left on device.

There are more missing checks in other utilities, but this should fix
the most critical ones.

Fixes Debian bug #922741.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Reviewed-by: Steve McIntyre <93sam@debian.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2019-03-05 10:23:47 +01:00
..
config.h Rewrite grub-install, grub-mkrescue, grub-mkstandalone and grub-mknetdir 2013-11-16 20:21:16 +01:00
console.h working copy, wo nested packaging 2010-08-17 19:03:22 +05:30
exec.h consolidate grub_util_exec code 2013-12-16 22:41:15 +04:00
getroot.h Rewrite grub-install, grub-mkrescue, grub-mkstandalone and grub-mknetdir 2013-11-16 20:21:16 +01:00
hostdisk.h Make grub_util_devmapper_part_to_disk and grub_util_find_partition_start 2013-12-24 14:16:57 +01:00
hostfile.h util: Detect more I/O errors 2019-03-05 10:23:47 +01:00
misc.h util: Detect more I/O errors 2019-03-05 10:23:47 +01:00
net.h Split emunet into platform-dependent and GRUB-binding parts. Keep 2013-10-15 11:55:20 +02:00