Re: [PATCH] libfdisk: fix get_partition_unused_primary()

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

 



On Fri, Nov 14, 2014 at 11:27:16AM +0600, Boris Egorov wrote:
> Now function takes address to variable and fills it with partition
> number. Caller treats return value as int and use it appropriately.

Yep, it's better. 

>  static int get_partition_unused_primary(struct fdisk_context *cxt,
...
> +	*partno = rc == 0 ? n : rc;
        ^^^^^^^^^^^
I have replaced this line with

 if (rc == 0)
    *partno = n;

it seems we don't have to mix partno and return codes here at all.

> +	return 0;

 return rc;


 Applied, thanks!

    Karel
    

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux