grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] return failure from grub-mount if fuse_main failed
@ 2013-03-09  8:08 Andrey Borzenkov
  0 siblings, 0 replies; only message in thread
From: Andrey Borzenkov @ 2013-03-09  8:08 UTC (permalink / raw)
  To: grub-devel

Currently there is no way to check that mount was successful. It caused
problem with os-prober which did not try kernel mount fallback.

Return value of fuse_init is currenty unused, but still it looks wrong
to always return success. In this case it should simply be void; if it
returns value, let value be correct.

Ref: https://bugzilla.novell.com/show_bug.cgi?id=802983

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>

---
 ChangeLog         |    5 +++++
 util/grub-mount.c |    5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3b4b3b4..bb9f431 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-09  Andrey Borzenkov <arvidjaar@gmail.com>
+
+	* util/grub-mount.c (fuse_init): Return error if fuse_main
+	failed.
+
 2013-03-07  Andrey Borzenkov <arvidjaar@gmail.com>
 
 	* grub-core/fs/iso9660.c (add_part): Remove always_inline attribute
diff --git a/util/grub-mount.c b/util/grub-mount.c
index d0ab6a2..1c59c59 100644
--- a/util/grub-mount.c
+++ b/util/grub-mount.c
@@ -407,7 +407,8 @@ fuse_init (void)
       return grub_errno;
     }
 
-  fuse_main (fuse_argc, fuse_args, &grub_opers, NULL);
+  if (fuse_main (fuse_argc, fuse_args, &grub_opers, NULL))
+    grub_error (GRUB_ERR_UNKNOWN_FS, "fuse_main failed");
 
   for (i = 0; i < num_disks; i++)
     {
@@ -427,7 +428,7 @@ fuse_init (void)
       grub_free (loop_name);
     }
 
-  return GRUB_ERR_NONE;
+  return grub_errno;
 }
 
 static struct argp_option options[] = {  
-- 
tg: (475ef5e..) bnc/802983 (depends on: master)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-09  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-09  8:08 [PATCH] return failure from grub-mount if fuse_main failed Andrey Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).