2010-08-03 Robert Millan <rmh@gnu.org>

Fix grub-emu build.
	
	* include/grub/util/misc.h: Move `<grub/util/libzfs.h>' to ...
	* include/grub/emu/misc.h: ... here.
	
	* include/grub/util/misc.h (grub_get_libzfs_handle): Move function ...
	* include/grub/emu/misc.h (grub_get_libzfs_handle): ... here.
	
	* util/misc.c: Remove `<grub/util/libzfs.h>'.
	[HAVE_LIBZFS] (libzfs_handle, fini_libzfs)
	(grub_get_libzfs_handle): Move to ...
	* kern/emu/misc.c [HAVE_LIBZFS] (__libzfs_handle, fini_libzfs)
	(grub_get_libzfs_handle): ... here.
This commit is contained in:
Robert Millan 2010-08-03 23:51:48 +02:00
parent c9f7ff97cf
commit 9dd6fd50b4
5 changed files with 45 additions and 26 deletions

View file

@ -1,3 +1,19 @@
2010-08-03 Robert Millan <rmh@gnu.org>
Fix grub-emu build.
* include/grub/util/misc.h: Move `<grub/util/libzfs.h>' to ...
* include/grub/emu/misc.h: ... here.
* include/grub/util/misc.h (grub_get_libzfs_handle): Move function ...
* include/grub/emu/misc.h (grub_get_libzfs_handle): ... here.
* util/misc.c: Remove `<grub/util/libzfs.h>'.
[HAVE_LIBZFS] (libzfs_handle, fini_libzfs)
(grub_get_libzfs_handle): Move to ...
* kern/emu/misc.c [HAVE_LIBZFS] (__libzfs_handle, fini_libzfs)
(grub_get_libzfs_handle): ... here.
2010-08-03 BVK Chaitanya <bvk.groups@gmail.com>
* script/execute.c (grub_script_execute_cmdline): Check for NULL

View file

@ -21,6 +21,7 @@
#include <grub/symbol.h>
#include <grub/types.h>
#include <grub/util/libzfs.h>
#ifdef __CYGWIN__
# include <sys/fcntl.h>
@ -75,4 +76,6 @@ extern char * canonicalize_file_name (const char *path);
int grub_device_mapper_supported (void);
#endif
libzfs_handle_t *grub_get_libzfs_handle (void);
#endif /* GRUB_EMU_MISC_H */

View file

@ -29,7 +29,6 @@
#include <grub/types.h>
#include <grub/symbol.h>
#include <grub/emu/misc.h>
#include <grub/util/libzfs.h>
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_fp_size (FILE *fp);
@ -61,6 +60,4 @@ char *canonicalize_file_name (const char *path);
void grub_util_init_nls (void);
libzfs_handle_t *grub_get_libzfs_handle (void);
#endif /* ! GRUB_UTIL_MISC_HEADER */

View file

@ -45,8 +45,11 @@
# include <libdevmapper.h>
#endif
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
#ifdef HAVE_LIBZFS
# include <grub/util/libzfs.h>
#endif
#ifdef HAVE_LIBNVPAIR
# include <grub/util/libnvpair.h>
#endif
@ -246,6 +249,28 @@ get_win32_path (const char *path)
}
#endif
#ifdef HAVE_LIBZFS
static libzfs_handle_t *__libzfs_handle;
static void
fini_libzfs (void)
{
libzfs_fini (__libzfs_handle);
}
libzfs_handle_t *
grub_get_libzfs_handle (void)
{
if (! __libzfs_handle)
{
__libzfs_handle = libzfs_init ();
atexit (fini_libzfs);
}
return __libzfs_handle;
}
#endif /* HAVE_LIBZFS */
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
/* Not ZFS-specific in itself, but for now it's only used by ZFS-related code. */
char *

View file

@ -36,7 +36,6 @@
#include <grub/misc.h>
#include <grub/cache.h>
#include <grub/util/misc.h>
#include <grub/util/libzfs.h>
#include <grub/mm.h>
#include <grub/term.h>
#include <grub/time.h>
@ -295,27 +294,6 @@ grub_util_init_nls (void)
#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */
}
#ifdef HAVE_LIBZFS
static libzfs_handle_t *libzfs_handle;
static void
fini_libzfs (void)
{
libzfs_fini (libzfs_handle);
}
libzfs_handle_t *
grub_get_libzfs_handle (void)
{
if (! libzfs_handle)
{
libzfs_handle = libzfs_init ();
atexit (fini_libzfs);
}
return libzfs_handle;
}
#endif /* HAVE_LIBZFS */
#endif /* GRUB_UTIL */
int