From 47972a242007a3739afdda393adc88d0b6db5265 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Mon, 9 Nov 2009 21:33:15 +0000 Subject: [PATCH] Save & restore grub_fs_autoload_hook while we're in read_fs_list() --- normal/autofs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/normal/autofs.c b/normal/autofs.c index cf552052a..d1ef761fb 100644 --- a/normal/autofs.c +++ b/normal/autofs.c @@ -61,8 +61,15 @@ read_fs_list (void) if (filename) { grub_file_t file; + grub_fs_autoload_hook_t tmp_autoload_hook; grub_sprintf (filename, "%s/fs.lst", prefix); + + /* This rules out the possibility that read_fs_list() is invoked + recursively when we call grub_file_open() below. */ + tmp_autoload_hook = grub_fs_autoload_hook; + grub_fs_autoload_hook = NULL; + file = grub_file_open (filename); if (file) { @@ -116,6 +123,7 @@ read_fs_list (void) } grub_file_close (file); + grub_fs_autoload_hook = tmp_autoload_hook; } grub_free (filename);