73aa139585
- libparted: Fix bug with dupe and empty name
162 lines
5.6 KiB
Diff
162 lines
5.6 KiB
Diff
From 591c7f6f39fff9126d7aa05c24e95961a91fd27f Mon Sep 17 00:00:00 2001
|
|
From: Jim Meyering <meyering@fb.com>
|
|
Date: Sun, 25 May 2014 21:16:44 -0700
|
|
Subject: [PATCH 120/125] maint: fix "make syntax-check" nits
|
|
|
|
* doc/parted.texi: Update copyright year to 2014.
|
|
* tests/gpt-header-move.py: Remove empty line at EOF.
|
|
* tests/t0281-gpt-grow.sh: Correct reversed args to compare.
|
|
* tests/t0282-gpt-move-backup.sh: Likewise.
|
|
* libparted/labels/gpt.c (gpt_partition_set_name): Change "Can not"
|
|
to "failed to" in diagnostic.
|
|
(gpt_partition_get_name): Likewise.
|
|
* tests/t1102-loop-label.sh (dev): Remove trailing space in
|
|
here document that creates expected output, and strip that
|
|
same trailing space from actual output.
|
|
* libparted/fs/jfs/jfs.c: Do not cast alloca return value.
|
|
* libparted/fs/reiserfs/reiserfs.c: Likewise.
|
|
* libparted/fs/xfs/xfs.c: Likewise.
|
|
---
|
|
doc/parted.texi | 2 +-
|
|
libparted/fs/jfs/jfs.c | 2 +-
|
|
libparted/fs/reiserfs/reiserfs.c | 3 +--
|
|
libparted/fs/xfs/xfs.c | 2 +-
|
|
libparted/labels/gpt.c | 4 ++--
|
|
tests/gpt-header-move.py | 1 -
|
|
tests/t0281-gpt-grow.sh | 2 +-
|
|
tests/t0282-gpt-move-backup.sh | 2 +-
|
|
tests/t1102-loop-label.sh | 4 ++--
|
|
9 files changed, 10 insertions(+), 12 deletions(-)
|
|
|
|
diff --git a/doc/parted.texi b/doc/parted.texi
|
|
index 97ce203..2b6f7f8 100644
|
|
--- a/doc/parted.texi
|
|
+++ b/doc/parted.texi
|
|
@@ -14,7 +14,7 @@ and manipulating partition tables.
|
|
@ifnottex @c texi2pdf don't understand copying and insertcopying ???
|
|
@c modifications must also be done in the titlepage
|
|
@copying
|
|
-Copyright @copyright{} 1999-2013 Free Software Foundation, Inc.
|
|
+Copyright @copyright{} 1999-2014 Free Software Foundation, Inc.
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
|
diff --git a/libparted/fs/jfs/jfs.c b/libparted/fs/jfs/jfs.c
|
|
index 5f0336c..47b2f07 100644
|
|
--- a/libparted/fs/jfs/jfs.c
|
|
+++ b/libparted/fs/jfs/jfs.c
|
|
@@ -37,7 +37,7 @@
|
|
static PedGeometry*
|
|
jfs_probe (PedGeometry* geom)
|
|
{
|
|
- struct superblock *sb = (struct superblock *)alloca (geom->dev->sector_size);
|
|
+ struct superblock *sb = alloca (geom->dev->sector_size);
|
|
|
|
if (geom->length * geom->dev->sector_size < JFS_SUPER_OFFSET)
|
|
return NULL;
|
|
diff --git a/libparted/fs/reiserfs/reiserfs.c b/libparted/fs/reiserfs/reiserfs.c
|
|
index 892cb8a..2efcdf3 100644
|
|
--- a/libparted/fs/reiserfs/reiserfs.c
|
|
+++ b/libparted/fs/reiserfs/reiserfs.c
|
|
@@ -57,8 +57,7 @@ static PedGeometry *reiserfs_probe(PedGeometry *geom)
|
|
int i;
|
|
|
|
PED_ASSERT(geom != NULL);
|
|
- reiserfs_super_block_t *sb =
|
|
- (reiserfs_super_block_t *)alloca (geom->dev->sector_size);
|
|
+ reiserfs_super_block_t *sb = alloca (geom->dev->sector_size);
|
|
|
|
for (i = 0; reiserfs_super_offset[i] != -1; i++) {
|
|
if (reiserfs_super_offset[i] >= geom->length)
|
|
diff --git a/libparted/fs/xfs/xfs.c b/libparted/fs/xfs/xfs.c
|
|
index 3fc97db..e4314a8 100644
|
|
--- a/libparted/fs/xfs/xfs.c
|
|
+++ b/libparted/fs/xfs/xfs.c
|
|
@@ -38,7 +38,7 @@ xfs_probe (PedGeometry* geom)
|
|
{
|
|
PedSector block_size;
|
|
PedSector block_count;
|
|
- struct xfs_sb *sb = (struct xfs_sb *)alloca (geom->dev->sector_size);
|
|
+ struct xfs_sb *sb = alloca (geom->dev->sector_size);
|
|
|
|
if (geom->length < XFS_SB_DADDR + 1)
|
|
return NULL;
|
|
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
|
|
index 76bf7e7..2a08a50 100644
|
|
--- a/libparted/labels/gpt.c
|
|
+++ b/libparted/labels/gpt.c
|
|
@@ -1896,7 +1896,7 @@ gpt_partition_set_name (PedPartition *part, const char *name)
|
|
err:
|
|
ped_exception_throw (PED_EXCEPTION_WARNING,
|
|
PED_EXCEPTION_IGNORE,
|
|
- _("Can not translate partition name"));
|
|
+ _("failed to translate partition name"));
|
|
iconv_close (conv);
|
|
}
|
|
|
|
@@ -1923,7 +1923,7 @@ gpt_partition_get_name (const PedPartition *part)
|
|
err:
|
|
ped_exception_throw (PED_EXCEPTION_WARNING,
|
|
PED_EXCEPTION_IGNORE,
|
|
- _("Can not translate partition name"));
|
|
+ _("failed to translate partition name"));
|
|
iconv_close (conv);
|
|
return "";
|
|
}
|
|
diff --git a/tests/gpt-header-move.py b/tests/gpt-header-move.py
|
|
index 977febb..8bee6bb 100644
|
|
--- a/tests/gpt-header-move.py
|
|
+++ b/tests/gpt-header-move.py
|
|
@@ -37,4 +37,3 @@ file.seek(512*(altlba-32))
|
|
file.write(backup)
|
|
file.write(gptheader)
|
|
file.write("\0" * (512 * 33))
|
|
-
|
|
diff --git a/tests/t0281-gpt-grow.sh b/tests/t0281-gpt-grow.sh
|
|
index 2f34532..36a2530 100644
|
|
--- a/tests/t0281-gpt-grow.sh
|
|
+++ b/tests/t0281-gpt-grow.sh
|
|
@@ -95,6 +95,6 @@ compare exp out || fail=1
|
|
|
|
parted -s $dev print > err 2>&1 || fail=1
|
|
grep Warning: err > k ; mv k err
|
|
-compare err /dev/null || fail=1
|
|
+compare /dev/null err || fail=1
|
|
|
|
Exit $fail
|
|
diff --git a/tests/t0282-gpt-move-backup.sh b/tests/t0282-gpt-move-backup.sh
|
|
index 27ef4a6..b827672 100644
|
|
--- a/tests/t0282-gpt-move-backup.sh
|
|
+++ b/tests/t0282-gpt-move-backup.sh
|
|
@@ -95,6 +95,6 @@ compare exp out || fail=1
|
|
|
|
parted -s $dev print > err 2>&1 || fail=1
|
|
grep Error: err > k ; mv k err
|
|
-compare err /dev/null || fail=1
|
|
+compare /dev/null err || fail=1
|
|
|
|
Exit $fail
|
|
diff --git a/tests/t1102-loop-label.sh b/tests/t1102-loop-label.sh
|
|
index 7f9ebfe..c6574c2 100644
|
|
--- a/tests/t1102-loop-label.sh
|
|
+++ b/tests/t1102-loop-label.sh
|
|
@@ -34,13 +34,13 @@ Model: Linux scsi_debug (scsi)
|
|
Disk DEVICE: 94.4MB
|
|
Sector size (logical/physical): ${ss}B/${ss}B
|
|
Partition Table: loop
|
|
-Disk Flags:
|
|
+Disk Flags:
|
|
|
|
Number Start End Size File system Flags
|
|
1 0.00B 94.4MB 94.4MB ext2
|
|
|
|
EOF
|
|
-mv out o2 && sed -e "s,$dev,DEVICE,;" o2 > out
|
|
+mv out o2 && sed -e "s,$dev,DEVICE,;s/ *$//" o2 > out
|
|
|
|
compare exp out || fail=1
|
|
parted -s $dev rm 1 || fail=1
|
|
--
|
|
1.9.3
|
|
|