[rtems commit] PR2157: fdisk partition table dump improvement

Gedare Bloom gedare at rtems.org
Tue Dec 3 19:50:30 UTC 2013


Module:    rtems
Branch:    master
Commit:    62ba20d759a30b9e0cef38985ef372caf67c3d49
Changeset: http://git.rtems.org/rtems/commit/?id=62ba20d759a30b9e0cef38985ef372caf67c3d49

Author:    Wendell P Silva <silvawp at gmail.com>
Date:      Tue Dec  3 14:55:34 2013 -0500

PR2157: fdisk partition table dump improvement

Show the correct index of partition's last block (partition end).

The documentation of struct rtems_bdpart_partition (P) says that the member
'end' is the "Block index for partition end (this block is not a part of the
partition)". Then, the fdisk's partition table dump should print ((P)->end -
1).

Currently, one can think that the last block of a partition P is superposing
the beginning of the partition (P + 1). Example:

----------------------------------------
       PARTITION TABLE
------------+------------+--------------
 BEGIN      | END        | TYPE
------------+------------+--------------
       2048 |     133120 |       FAT 32
     133120 |   15628032 |       FAT 32
------------+------------+--------------

With be proposed patch, it would be:
----------------------------------------
       PARTITION TABLE
------------+------------+--------------
 BEGIN      | END        | TYPE
------------+------------+--------------
       2048 |     133119 |       FAT 32
     133120 |   15628031 |       FAT 32
------------+------------+--------------

---

 cpukit/libblock/src/bdpart-dump.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpukit/libblock/src/bdpart-dump.c b/cpukit/libblock/src/bdpart-dump.c
index ec19166..b886622 100644
--- a/cpukit/libblock/src/bdpart-dump.c
+++ b/cpukit/libblock/src/bdpart-dump.c
@@ -87,7 +87,7 @@ void rtems_bdpart_dump( const rtems_bdpart_partition *pt, size_t count)
     printf(
       " %10" PRIu32 " | %10" PRIu32 " |%52s\n",
       p->begin,
-      p->end,
+      p->end - 1U,
       type
     );
   }




More information about the vc mailing list