Re: [PATCH 6/6] fdisk: add debug support

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

 



On Mon, May 21, 2012 at 10:32:25PM +0200, Davidlohr Bueso wrote:
>  fdisk/fdisk.c |    2 ++
>  fdisk/fdisk.h |   27 +++++++++++++++++++++++++++
>  fdisk/utils.c |   33 ++++++++++++++++++++++++++++++++-
>  3 files changed, 61 insertions(+), 1 deletions(-)

 Applied, thanks.

> +void fdisk_init_debug(int mask)
> +{
> +	if (fdisk_debug_mask & FDISK_DEBUG_INIT)
> +		return;
> +	if (!mask) {
> +		char *str = getenv("FDISK_DEBUG");
> +		if (str)
> +			fdisk_debug_mask = strtoul(str, 0, 0);
> +	} else
> +		fdisk_debug_mask = mask;
> +
> +	if (fdisk_debug_mask)
> +		printf("fdisk: debug mask set to 0x%04x.\n",
> +		       fdisk_debug_mask);

 this is bug (in libmount too), the message should be printed to
 stderr as all others debug messages.

 I have added dbgprint() inline function to standardize the output, so

> +		DBG(CONTEXT, printf("opened %s as read-only\n", fname));

 should be 

        DBG(CONTEXT, dbgprint("opened %s as read-only", fname));

 All the changes are already pushed to the repository.

    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