[parted-devel] [PATCH 2/2] parted: make align-check work in interactive mode

Petr Uzel petr.uzel at suse.cz
Thu May 27 12:54:54 UTC 2010


On Thu, May 27, 2010 at 12:01:23PM +0200, Jim Meyering wrote:
> 
> > What about the 'FIXME:' part in original patch? It seems to work fine
> > as is, but perhaps I'm missing something...
> 
> That return code appears to be unused in interactive mode.
> 
>   # ./parted /dev/sdd
>   GNU Parted 2.2.76-33c1
>   Using /dev/sdd
>   Welcome to GNU Parted! Type 'help' to view a list of commands.
>   (parted) align-check opt 1
>   1 not aligned
>   (parted) q

If I'm not mistaken, the return value is propagated to
interactive_mode() (parted/ui.c:1565) and there, based on the
return value, the command_line_flush() is either executed or skipped.
I don't understand this code much, but it looks to me that
command_line_flush() should be executed everytime (why would
we need to keep the command_line buffer?).


> 
> How about just removing the FIXME comment?
> 
> From b177eec755b7366c8e776e0962b01999e58ba8bf Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering at redhat.com>
> Date: Thu, 27 May 2010 11:59:22 +0200
> Subject: [PATCH] maint: remove a FIXME comment
> 
> * parted/parted.c (do_align_check): The value returned
> by this function is ignored in interactive mode, so remove
> the FIXME comment.
> ---
>  parted/parted.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/parted/parted.c b/parted/parted.c
> index 7723d18..45ae98c 100644
> --- a/parted/parted.c
> +++ b/parted/parted.c
> @@ -2094,7 +2094,6 @@ do_align_check (PedDevice **dev)
> 
>    ped_disk_destroy (disk);
> 
> -  /* FIXME: perhaps we should always return 1 when in interactive mode???  */
>    return aligned ? 1 : 0;
> 
>  error_destroy_disk:
> --
> 1.7.1.348.gb26ba
> 
> _______________________________________________
> parted-devel mailing list
> parted-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Petr

--
Petr Uzel
IRC: ptr_uzl @ freenode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20100527/744fcfac/attachment.pgp>


More information about the parted-devel mailing list