grub2/grub-1.99-handle-fwrite-return.patch

60 lines
1.7 KiB
Diff
Raw Normal View History

2011-03-03 22:08:24 +00:00
From de1c35857ee803653d3ffd94eb5d3f3b45ab000e Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 2 Mar 2011 11:29:28 -0500
Subject: [PATCH] Don't ignore fwrite's return since we build with -Wno-unused.
---
util/grub-mklayout.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/util/grub-mklayout.c b/util/grub-mklayout.c
index 04501cb..beea3eb 100644
--- a/util/grub-mklayout.c
+++ b/util/grub-mklayout.c
@@ -324,6 +324,7 @@ write_file (FILE *out, struct grub_keyboard_layout *layout)
{
grub_uint32_t version;
unsigned i;
+ int rc;
version = grub_cpu_to_le32 (GRUB_KEYBOARD_LAYOUTS_VERSION);
@@ -342,10 +343,10 @@ write_file (FILE *out, struct grub_keyboard_layout *layout)
layout->keyboard_map_shift_l3[i]
= grub_cpu_to_le32(layout->keyboard_map_shift_l3[i]);
- fwrite (GRUB_KEYBOARD_LAYOUTS_FILEMAGIC, 1,
+ rc = fwrite (GRUB_KEYBOARD_LAYOUTS_FILEMAGIC, 1,
GRUB_KEYBOARD_LAYOUTS_FILEMAGIC_SIZE, out);
- fwrite (&version, sizeof (version), 1, out);
- fwrite (layout, 1, sizeof (*layout), out);
+ rc = fwrite (&version, sizeof (version), 1, out);
+ rc = fwrite (layout, 1, sizeof (*layout), out);
}
static void
--
1.7.3.1
diff --git a/util/grub-menulst2cfg.c b/util/grub-menulst2cfg.c
index 513af47..308f8e9 100644
--- a/util/grub-menulst2cfg.c
+++ b/util/grub-menulst2cfg.c
@@ -34,6 +34,7 @@ main (int argc, char **argv)
size_t bufsize = 0;
char *suffix = xstrdup ("");
int suffixlen = 0;
+ int rc;
if (argc >= 2 && argv[1][0] == '-')
{
@@ -111,7 +112,7 @@ main (int argc, char **argv)
if (entryname)
fprintf (out, "}\n\n");
- fwrite (suffix, 1, suffixlen, out);
+ rc = fwrite (suffix, 1, suffixlen, out);
free (buf);
free (suffix);