bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for libparted/linux.c


From: Andrew Clausen
Subject: Re: patch for libparted/linux.c
Date: Fri, 16 Apr 2004 09:46:44 +1000
User-agent: Mutt/1.5.5.1+cvs20040105i

On Tue, Apr 13, 2004 at 07:55:24PM +0200, bold wrote:
> to patch in libparted/linux.c 
>  
>  
> @@ -405,7 +405,11 @@ 
>  
> if (_kernel_has_blkgetsize64()) { 
> if (ioctl(arch_specific->fd, BLKGETSIZE64, &bytes) == 0) { 
> - return bytes / _device_get_sector_size(dev); 
> + int sect_size=_device_get_sector_size(dev); 
> + if (sect_size) 
> + return bytes / sect_size; 
> + else 
> + return 0; 
> } 
> } 
>  
>  
> this is against a divide by 0 error which appears at some people when they
> try  
> to start qtparted. 
>  
>  
> hope you will include it in a next release. 

I decided to make _device_get_sector_size() always return something
sane (>0).

Thanks,
Andrew





reply via email to

[Prev in Thread] Current Thread [Next in Thread]