bbc6a8
From e66dc5d71ebfc9763420a76c274e6980d54641c3 Mon Sep 17 00:00:00 2001
bbc6a8
From: Vladimir Serbinenko <phcoder@gmail.com>
bbc6a8
Date: Mon, 7 Aug 2017 18:08:39 +0200
31cddd
Subject: [PATCH] Fail if xorriso failed.
bbc6a8
bbc6a8
If xorriso failed most likely we didn't generate a meaningful image.
bbc6a8
---
bbc6a8
 util/grub-mkrescue.c | 6 ++++--
bbc6a8
 1 file changed, 4 insertions(+), 2 deletions(-)
bbc6a8
bbc6a8
diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c
ec4acb
index 38f1543974e..9545945d8f3 100644
bbc6a8
--- a/util/grub-mkrescue.c
bbc6a8
+++ b/util/grub-mkrescue.c
bbc6a8
@@ -429,6 +429,7 @@ main (int argc, char *argv[])
bbc6a8
   char **argp_argv;
bbc6a8
   int xorriso_tail_argc;
bbc6a8
   char **xorriso_tail_argv;
bbc6a8
+  int rv;
bbc6a8
 
bbc6a8
   grub_util_host_init (&argc, &argv);
bbc6a8
   grub_util_disable_fd_syncs ();
bbc6a8
@@ -794,7 +795,6 @@ main (int argc, char *argv[])
bbc6a8
       free (efidir_efi_boot);
bbc6a8
 
bbc6a8
       efiimgfat = grub_util_path_concat (2, iso9660_dir, "efi.img");
bbc6a8
-      int rv;
bbc6a8
       rv = grub_util_exec ((const char * []) { "mformat", "-C", "-f", "2880", "-L", "16", "-i",
bbc6a8
 	    efiimgfat, "::", NULL });
bbc6a8
       if (rv != 0)
bbc6a8
@@ -967,7 +967,9 @@ main (int argc, char *argv[])
bbc6a8
 
bbc6a8
   xorriso_argv[xorriso_argc] = NULL;
bbc6a8
 
bbc6a8
-  grub_util_exec ((const char *const *)xorriso_argv);
bbc6a8
+  rv = grub_util_exec ((const char *const *)xorriso_argv);
bbc6a8
+  if (rv != 0)
bbc6a8
+    grub_util_error ("`%s` invocation failed\n", "xorriso");
bbc6a8
 
bbc6a8
   grub_util_unlink_recursive (iso9660_dir);
bbc6a8