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

Petr Uzel petr.uzel at suse.cz
Fri May 28 14:51:50 UTC 2010


On Thu, May 27, 2010 at 03:52:59PM +0200, Jim Meyering wrote:
> Petr Uzel wrote:
> > 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.
> >>
> >
> > 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.
> 
> That is true.
> However, does it make a difference?

I don't know :)
But since all of the do_* functions seem to return 1 on success,
I'd make do_align_check() consistent, so:


From 997d18e6c4a1771edd215c3d0baacaafc6046686 Mon Sep 17 00:00:00 2001
From: Petr Uzel <petr.uzel at suse.cz>
Date: Fri, 28 May 2010 16:42:20 +0200
Subject: [PATCH] parted: do_align_check returns always 1 in interactive mode

* parted/parted.c (do_align_check): always return 1 in interactive mode
---
 parted/parted.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/parted/parted.c b/parted/parted.c
index 7723d18..bd31e19 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -2094,8 +2094,10 @@ do_align_check (PedDevice **dev)
 
   ped_disk_destroy (disk);
 
-  /* FIXME: perhaps we should always return 1 when in interactive mode???  */
-  return aligned ? 1 : 0;
+  if (opt_script_mode)
+    return aligned ? 1 : 0;
+  else
+    return 1;
 
 error_destroy_disk:
   ped_disk_destroy (disk);
-- 
1.6.4.2



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/20100528/6c716628/attachment.pgp>


More information about the parted-devel mailing list