2010-08-09 Robert Millan <rmh@gnu.org>
* kern/emu/misc.c (grub_make_system_path_relative_to_its_root): Filter out unused variables on non-ZFS build.
This commit is contained in:
parent
346c207240
commit
07f360e92d
2 changed files with 16 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2010-08-09 Robert Millan <rmh@gnu.org>
|
||||||
|
|
||||||
|
* kern/emu/misc.c (grub_make_system_path_relative_to_its_root): Filter
|
||||||
|
out unused variables on non-ZFS build.
|
||||||
|
|
||||||
2010-08-08 Robert Millan <rmh@gnu.org>
|
2010-08-08 Robert Millan <rmh@gnu.org>
|
||||||
|
|
||||||
Fix path generation for sub-filesystems in ZFS.
|
Fix path generation for sub-filesystems in ZFS.
|
||||||
|
|
|
@ -307,12 +307,15 @@ char *
|
||||||
grub_make_system_path_relative_to_its_root (const char *path)
|
grub_make_system_path_relative_to_its_root (const char *path)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char *p, *buf, *buf2, *buf3;
|
char *p, *buf, *buf2, *buf3, *ret;
|
||||||
char *poolname = NULL, *poolfs = NULL, *ret;
|
|
||||||
uintptr_t offset = 0;
|
uintptr_t offset = 0;
|
||||||
dev_t num;
|
dev_t num;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
|
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
|
||||||
|
char *poolfs = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* canonicalize. */
|
/* canonicalize. */
|
||||||
p = canonicalize_file_name (path);
|
p = canonicalize_file_name (path);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
|
@ -320,7 +323,10 @@ grub_make_system_path_relative_to_its_root (const char *path)
|
||||||
|
|
||||||
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
|
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
|
||||||
/* For ZFS sub-pool filesystems, could be extended to others (btrfs?). */
|
/* For ZFS sub-pool filesystems, could be extended to others (btrfs?). */
|
||||||
grub_find_zpool_from_dir (p, &poolname, &poolfs);
|
{
|
||||||
|
char *dummy;
|
||||||
|
grub_find_zpool_from_dir (p, &dummy, &poolfs);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
len = strlen (p) + 1;
|
len = strlen (p) + 1;
|
||||||
|
@ -401,12 +407,14 @@ grub_make_system_path_relative_to_its_root (const char *path)
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
|
||||||
if (poolfs)
|
if (poolfs)
|
||||||
{
|
{
|
||||||
ret = xasprintf ("/%s/@%s", poolfs, buf3);
|
ret = xasprintf ("/%s/@%s", poolfs, buf3);
|
||||||
free (buf3);
|
free (buf3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
ret = buf3;
|
ret = buf3;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue