[Parted-maintainers] Bug#548436: new patch, known working

Aurelien Jarno aurelien at aurel32.net
Thu Jan 14 20:27:24 UTC 2010


On Wed, Dec 09, 2009 at 09:58:22PM +0100, Robert Millan wrote:
> Good catch.  This needed a new variable to cope with the !result early
> return.  Here's a new patch.

I confirm it works well. I have added this patch to the libparted udebs
used to build the daily images.

> -- 
> 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-12-09 21:54:30.000000000 +0100
> +++ parted-1.8.8.git.2009.07.19.new/libparted/arch/freebsd.c	2009-12-09 21:57:18.000000000 +0100
> @@ -1109,14 +1109,24 @@
>  {
>  	int		path_len = strlen (dev->path);
>  	int		result_len = path_len + 16;
> +	int		is_gpt;
>  	char*		result;
> +	PedDisk*	disk;
> +
> +	disk = ped_disk_new (dev);
> +	if (!disk)
> +		return NULL;
>  
>  	result = (char*) ped_malloc (result_len);
>  	if (!result)
>  		return NULL;
>  
> +	is_gpt = !strcmp (disk->type->name, "gpt");
> +
> +	ped_disk_destroy (disk);
> +
>  	/* append slice number (ad0, partition 1 => ad0s1)*/
> -	snprintf (result, result_len, "%ss%d", dev->path, num);
> +	snprintf (result, result_len, is_gpt ? "%sp%d" : "%ss%d", dev->path, num);
>  	
>  	return result;
>  }


-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien at aurel32.net                 http://www.aurel32.net





More information about the Parted-maintainers mailing list