Re: [PATCH] mkfs.minix: remove die()

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

 



On Thu, Apr 07, 2011 at 03:45:06PM -0300, Davidlohr Bueso wrote:
> This patch is the first in the series to add support for v3 and massive cleanups.
> 
> From: Davidlohr Bueso <dave@xxxxxxx>
> Date: Thu, 7 Apr 2011 15:41:30 -0300
> 
> This patch gets rid of the die() function and replaces it with errx(3). The exit code continues to be 8.
> 
> Signed-off-by: Davidlohr Bueso <dave@xxxxxxx>
> ---
>  disk-utils/mkfs.minix.c |   70 +++++++++++++++++++++--------------------------
>  1 files changed, 31 insertions(+), 39 deletions(-)
> 
> diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
> index 807a571..53b5900 100644
> --- a/disk-utils/mkfs.minix.c
> +++ b/disk-utils/mkfs.minix.c
> @@ -141,14 +141,6 @@ static unsigned long req_nr_inodes = 0;
>  #define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1))
>  #define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1))
>  
> -static void
> -die(char *str) {
> -	fprintf(stderr, "%s: ", program_name);
> -	fprintf(stderr, str, device_name);
> -	fprintf(stderr, "\n");
> -	exit(8);
> -}
> -
>  static void __attribute__((__noreturn__))
>  usage(void) {
>  	errx(16, _("Usage: %s [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]"),
> @@ -174,7 +166,7 @@ check_mount(void) {
>  	if (!mnt)
>  		return;

 Maybe you can use (in some another patch) stuff from lib/ismounted.c
 rather than this local implementation. 

> -	die(_("%s is mounted; will not make a filesystem here!"));
> +	errx(8, _("%s is mounted; will not make a filesystem here!"), device_name);

 Please, define and use EXIT_SOMETHING instead of the magic number '8'.

 I'd like to apply complete set of the minix patches rather than add
 individual patches. It seems strange to have in repository support
 for "-3" command line option without a real minix v3 support. So, all
 or nothing ;-)

    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