Merge mainline into nestpart
This commit is contained in:
commit
35b86ff407
4 changed files with 54 additions and 28 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* partmap/sun.c (sun_partition_map_iterate): Restructure flow to fix
|
||||||
|
buggy hook call and memory leak.
|
||||||
|
|
||||||
|
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* commands/ls.c (grub_ls_list_files): Free pathname on exit.
|
||||||
|
|
||||||
|
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* fs/fat.c (grub_fat_iterate_dir): Free unibuf at exit.
|
||||||
|
|
||||||
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* loader/i386/pc/xnu.c (grub_xnu_set_video): Add const qualifier to
|
* loader/i386/pc/xnu.c (grub_xnu_set_video): Add const qualifier to
|
||||||
|
|
|
@ -87,14 +87,13 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
|
||||||
int print_files_long (const char *filename,
|
int print_files_long (const char *filename,
|
||||||
const struct grub_dirhook_info *info)
|
const struct grub_dirhook_info *info)
|
||||||
{
|
{
|
||||||
char *pathname;
|
|
||||||
|
|
||||||
if ((! all) && (filename[0] == '.'))
|
if ((! all) && (filename[0] == '.'))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (! info->dir)
|
if (! info->dir)
|
||||||
{
|
{
|
||||||
grub_file_t file;
|
grub_file_t file;
|
||||||
|
char *pathname;
|
||||||
|
|
||||||
if (dirname[grub_strlen (dirname) - 1] == '/')
|
if (dirname[grub_strlen (dirname) - 1] == '/')
|
||||||
pathname = grub_xasprintf ("%s%s", dirname, filename);
|
pathname = grub_xasprintf ("%s%s", dirname, filename);
|
||||||
|
@ -110,6 +109,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
|
||||||
if (! file)
|
if (! file)
|
||||||
{
|
{
|
||||||
grub_errno = 0;
|
grub_errno = 0;
|
||||||
|
grub_free (pathname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +144,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
|
||||||
|
|
||||||
}
|
}
|
||||||
grub_file_close (file);
|
grub_file_close (file);
|
||||||
|
grub_free (pathname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
grub_printf ("%-12s", "DIR");
|
grub_printf ("%-12s", "DIR");
|
||||||
|
|
1
fs/fat.c
1
fs/fat.c
|
@ -592,6 +592,7 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data,
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_free (filename);
|
grub_free (filename);
|
||||||
|
grub_free (unibuf);
|
||||||
|
|
||||||
return grub_errno;
|
return grub_errno;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,20 +90,32 @@ sun_partition_map_iterate (grub_disk_t disk,
|
||||||
grub_partition_t p;
|
grub_partition_t p;
|
||||||
struct grub_sun_block block;
|
struct grub_sun_block block;
|
||||||
int partnum;
|
int partnum;
|
||||||
|
grub_err_t err;
|
||||||
|
|
||||||
p = (grub_partition_t) grub_zalloc (sizeof (struct grub_partition));
|
p = (grub_partition_t) grub_zalloc (sizeof (struct grub_partition));
|
||||||
if (! p)
|
if (! p)
|
||||||
return grub_errno;
|
return grub_errno;
|
||||||
|
|
||||||
p->partmap = &grub_sun_partition_map;
|
p->partmap = &grub_sun_partition_map;
|
||||||
if (grub_disk_read (disk, 0, 0, sizeof (struct grub_sun_block),
|
err = grub_disk_read (disk, 0, 0, sizeof (struct grub_sun_block),
|
||||||
&block) == GRUB_ERR_NONE)
|
&block);
|
||||||
|
if (err)
|
||||||
{
|
{
|
||||||
|
grub_free (p);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.magic))
|
if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.magic))
|
||||||
grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table");
|
{
|
||||||
|
grub_free (p);
|
||||||
|
return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table");
|
||||||
|
}
|
||||||
|
|
||||||
if (! grub_sun_is_valid (&block))
|
if (! grub_sun_is_valid (&block))
|
||||||
grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum");
|
{
|
||||||
|
grub_free (p);
|
||||||
|
return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum");
|
||||||
|
}
|
||||||
|
|
||||||
/* Maybe another error value would be better, because partition
|
/* Maybe another error value would be better, because partition
|
||||||
table _is_ recognized but invalid. */
|
table _is_ recognized but invalid. */
|
||||||
|
@ -127,7 +139,6 @@ sun_partition_map_iterate (grub_disk_t disk,
|
||||||
partnum = GRUB_PARTMAP_SUN_MAX_PARTS;
|
partnum = GRUB_PARTMAP_SUN_MAX_PARTS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
grub_free (p);
|
grub_free (p);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue