grub/grub-core/osdep/windows
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
..
blocklist.c Mark strings for translation and add remaining ones to exclude list. 2013-12-18 06:50:24 +01:00
config.c Clarify several translatable messages. 2013-12-21 01:41:16 +01:00
cputime.c Move cpu time retrieval to separate grub_util_get_cpu_time_ms 2013-10-15 13:13:53 +02:00
dl.c Decrease number of strings to translate. 2013-12-18 07:26:13 +01:00
emuconsole.c * grub-core/osdep/windows/emuconsole.c: Remove unsigned comparison >= 0. 2013-12-08 18:16:32 +01:00
getroot.c Do not use TCHAR string functions as they are not available on cygwin. 2013-12-14 23:25:30 +01:00
hostdisk.c util: Detect more I/O errors 2019-03-05 10:23:47 +01:00
init.c Fix canonicalize_file_name clash. 2015-03-04 01:00:19 +01:00
password.c Move password-querying (util-version) routines to grub-core/osdep. 2013-10-08 17:51:39 +02:00
platform.c windows: correct LBA in generated EFI HDD media paths 2015-12-19 11:32:49 +03:00
random.c Move OS-dependent files to grub-core/osdep and document it. 2013-10-08 17:30:22 +02:00
relpath.c Do not use TCHAR string functions as they are not available on cygwin. 2013-12-14 23:25:30 +01:00
sleep.c * grub-core/osdep/windows/sleep.c: Add missing config.h. 2013-10-08 20:02:07 +02:00