[Parted-maintainers] Bug#548436: new patch, known working
Aurelien Jarno
aurelien at aurel32.net
Wed Dec 9 11:29:15 UTC 2009
On Sun, Dec 06, 2009 at 01:10:47AM +0100, Robert Millan wrote:
> tags 548436
> thanks
>
> Hi,
>
> Barring a minor variable name mistake, the patch works. I've just
> built a d-i image to test it, and it's able to create filesystems
> on GPT.
>
> Here's an updated version.
>
> --
> Robert Millan
>
> The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
> how) you may access your data; but nobody's threatening your freedom: we
> still allow you to remove your data and not access it at all."
> diff -ur parted-1.8.8.git.2009.07.19/libparted/arch/freebsd.c parted-1.8.8.git.2009.07.19.new/libparted/arch/freebsd.c
> --- parted-1.8.8.git.2009.07.19/libparted/arch/freebsd.c 2009-11-21 10:35:29.000000000 +0100
> +++ parted-1.8.8.git.2009.07.19.new/libparted/arch/freebsd.c 2009-11-21 10:35:56.000000000 +0100
> @@ -1110,13 +1110,18 @@
> int path_len = strlen (dev->path);
> int result_len = path_len + 16;
> char* result;
> + PedDisk* disk;
> +
> + disk = ped_disk_new (dev);
> + if (!disk)
> + return NULL;
>
> result = (char*) ped_malloc (result_len);
> if (!result)
> return NULL;
>
> /* append slice number (ad0, partition 1 => ad0s1)*/
> - snprintf (result, result_len, "%ss%d", dev->path, num);
> + snprintf (result, result_len, strcmp (disk->type->name, "gpt") ? "%ss%d" : "%sp%d", dev->path, num);
>
> return result;
Shouldn't disk be freed after use?
> }
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien at aurel32.net http://www.aurel32.net
More information about the Parted-maintainers
mailing list