[Parted-commits] GNU Parted Official Repository: Changes to 'master'
David Cantrell
dcantrell-guest at alioth.debian.org
Wed May 2 18:21:11 UTC 2007
NEWS | 23 +----------------------
configure.ac | 16 +++++++++++-----
libparted/arch/linux.c | 12 +++++-------
libparted/debug.c | 49 +++++++++++++++++++++++++------------------------
libparted/device.c | 12 ++++++------
libparted/disk.c | 28 ++++++++++++++--------------
libparted/exception.c | 13 ++++++-------
libparted/labels/dos.c | 3 +--
parted.lsm | 6 +++---
parted/parted.c | 14 ++++++++------
parted/table.c | 7 +++++--
11 files changed, 85 insertions(+), 98 deletions(-)
New commits:
commit 213aa015df7d9019b04611cd19fc3d8328072cb2
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Mon Apr 30 09:44:24 2007 -0400
Whitespace cleanups.
diff --git a/libparted/debug.c b/libparted/debug.c
index 82d05c4..0841938 100644
--- a/libparted/debug.c
+++ b/libparted/debug.c
@@ -61,11 +61,11 @@ void ped_debug ( const int level, const char* file, int line,
{
va_list arg_list;
char* msg_concat = ped_malloc(8192);
-
+
va_start ( arg_list, msg );
vsnprintf ( msg_concat, 8192, msg, arg_list );
va_end ( arg_list );
-
+
debug_handler ( level, file, line, function, msg_concat );
ped_free ( msg_concat );
@@ -83,38 +83,39 @@ void ped_debug_set_handler ( PedDebugHandler* handler )
* Check an assertion.
* Do not call this directly -- use PED_ASSERT() instead.
*/
-int ped_assert ( int cond, const char* cond_text,
- const char* file, int line, const char* function )
+int ped_assert (int cond, const char* cond_text,
+ const char* file, int line, const char* function)
{
- PedExceptionOption opt;
+ PedExceptionOption opt;
- if ( cond )
- return 1;
+ if (cond)
+ return 1;
#if HAVE_BACKTRACE
- /* Print backtrace stack */
- void *stack[20];
- char **strings, **string;
+ /* Print backtrace stack */
+ void *stack[20];
+ char **strings, **string;
int size = backtrace(stack, 20);
- strings = backtrace_symbols(stack, size);
+ strings = backtrace_symbols(stack, size);
+
+ if (strings) {
+ printf(_("Backtrace has %d calls on stack:\n"), size);
- if (strings) {
- printf(_("Backtrace has %d calls on stack:\n"), size);
- for (string = strings; size > 0; size--, string++)
- printf(" %d: %s\n", size, *string);
+ for (string = strings; size > 0; size--, string++)
+ printf(" %d: %s\n", size, *string);
- free(strings);
- }
+ free(strings);
+ }
#endif
- /* Throw the exception */
- opt = ped_exception_throw (
- PED_EXCEPTION_BUG,
- PED_EXCEPTION_IGNORE_CANCEL,
- _("Assertion (%s) at %s:%d in function %s() failed."),
- cond_text, file, line, function );
+ /* Throw the exception */
+ opt = ped_exception_throw (
+ PED_EXCEPTION_BUG,
+ PED_EXCEPTION_IGNORE_CANCEL,
+ _("Assertion (%s) at %s:%d in function %s() failed."),
+ cond_text, file, line, function);
- return ( opt == PED_EXCEPTION_IGNORE );
+ return (opt == PED_EXCEPTION_IGNORE);
}
#endif /* DEBUG */
commit 1cb7f0989ea12e66989b7b02c04d3ff2506e792d
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Mon Apr 30 09:42:33 2007 -0400
Whitespace cleanups.
diff --git a/libparted/disk.c b/libparted/disk.c
index 2e3feaf..d23fe15 100644
--- a/libparted/disk.c
+++ b/libparted/disk.c
@@ -154,25 +154,25 @@ ped_disk_type_get (const char* name)
PedDiskType*
ped_disk_probe (PedDevice* dev)
{
- PedDiskType* walk = NULL;
+ PedDiskType* walk = NULL;
- PED_ASSERT (dev != NULL, return NULL);
+ PED_ASSERT (dev != NULL, return NULL);
- if (!ped_device_open (dev))
- return NULL;
+ if (!ped_device_open (dev))
+ return NULL;
- ped_exception_fetch_all ();
- for (walk = ped_disk_type_get_next (NULL); walk;
- walk = ped_disk_type_get_next (walk))
- if (walk->ops->probe (dev))
- break;
+ ped_exception_fetch_all ();
+ for (walk = ped_disk_type_get_next (NULL); walk;
+ walk = ped_disk_type_get_next (walk))
+ if (walk->ops->probe (dev))
+ break;
- if (ped_exception)
- ped_exception_catch ();
- ped_exception_leave_all ();
+ if (ped_exception)
+ ped_exception_catch ();
+ ped_exception_leave_all ();
- ped_device_close (dev);
- return walk;
+ ped_device_close (dev);
+ return walk;
}
/**
commit d22044a7ea326e758c203595b18324a6f37061d9
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Mon Apr 30 09:22:44 2007 -0400
Whitespace cleanups.
diff --git a/libparted/exception.c b/libparted/exception.c
index d109209..f73ba6c 100644
--- a/libparted/exception.c
+++ b/libparted/exception.c
@@ -187,13 +187,12 @@ ped_exception_get_handler (void)
void
ped_exception_catch ()
{
- if (ped_exception) {
- ped_exception = 0;
-
- ped_free (ex->message);
- ped_free (ex);
- ex = NULL;
- }
+ if (ped_exception) {
+ ped_exception = 0;
+ if (ex->message) ped_free (ex->message);
+ if (ex) ped_free (ex);
+ ex = NULL;
+ }
}
static PedExceptionOption
commit eab39a54b4d8708c68fb3cd0a0d9fa0ef520e1d1
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Mon Apr 30 09:21:48 2007 -0400
Whitespace cleanups.
diff --git a/libparted/device.c b/libparted/device.c
index e079fca..46940b9 100644
--- a/libparted/device.c
+++ b/libparted/device.c
@@ -338,14 +338,14 @@ ped_device_end_external_access (PedDevice* dev)
*/
int
ped_device_read (const PedDevice* dev, void* buffer, PedSector start,
- PedSector count)
+ PedSector count)
{
- PED_ASSERT (dev != NULL, return 0);
- PED_ASSERT (buffer != NULL, return 0);
- PED_ASSERT (!dev->external_mode, return 0);
- PED_ASSERT (dev->open_count > 0, return 0);
+ PED_ASSERT (dev != NULL, return 0);
+ PED_ASSERT (buffer != NULL, return 0);
+ PED_ASSERT (!dev->external_mode, return 0);
+ PED_ASSERT (dev->open_count > 0, return 0);
- return (ped_architecture->dev_ops->read) (dev, buffer, start, count);
+ return (ped_architecture->dev_ops->read) (dev, buffer, start, count);
}
/**
commit 5ac8e21a86ecf8c9e639e4aeadad8b778052841c
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Mon Apr 23 16:41:02 2007 -0400
Revert "Remove unused label."
This reverts commit bfd9a6d8b6322d870650b0e92bd936035ab28e76.
diff --git a/libparted/fs/linux_swap/linux_swap.c b/libparted/fs/linux_swap/linux_swap.c
index 3dd3780..a8e95fd 100644
--- a/libparted/fs/linux_swap/linux_swap.c
+++ b/libparted/fs/linux_swap/linux_swap.c
@@ -121,7 +121,7 @@ _generic_swap_probe (PedGeometry* geom, int kind)
error_close_fs:
swap_close (fs);
-
+error:
return NULL;
}
commit 91f10262190f01b96dfabe8043619e0f86141bea
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Mon Apr 23 16:25:11 2007 -0400
Patch from Jim Meyering <jim at meyering.net> to linux_write() to support logical
sector sizes other than 512 (PED_SECTOR_SIZE_DEFAULT).
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 285e2b9..b921730 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -1531,9 +1531,7 @@ linux_write (PedDevice* dev, const void* buffer, PedSector start,
PedSector count)
{
LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
- int status;
PedExceptionOption ex_status;
- size_t write_length = count * dev->sector_size;
void* diobuf;
void* diobuf_start;
@@ -1591,15 +1589,15 @@ linux_write (PedDevice* dev, const void* buffer, PedSector start,
printf ("ped_device_write (\"%s\", %p, %d, %d)\n",
dev->path, buffer, (int) start, (int) count);
#else
+ size_t write_length = count * dev->sector_size;
dev->dirty = 1;
- if (posix_memalign(&diobuf, PED_SECTOR_SIZE_DEFAULT,
- count * PED_SECTOR_SIZE_DEFAULT) != 0)
+ if (posix_memalign(&diobuf, dev->sector_size, write_length) != 0)
return 0;
- memcpy(diobuf, buffer, count * PED_SECTOR_SIZE_DEFAULT);
+ memcpy(diobuf, buffer, write_length);
diobuf_start = diobuf;
while (1) {
- status = write (arch_specific->fd, diobuf, write_length);
- if (status == count * dev->sector_size) break;
+ ssize_t status = write (arch_specific->fd, diobuf, write_length);
+ if (status == write_length) break;
if (status > 0) {
write_length -= status;
diobuf = (char *) diobuf + status;
commit fed8d32e95d429222d30e1cf0679c4ca30632288
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Mon Apr 23 16:02:13 2007 -0400
Fix primary partition cylinder alignment error for DOS disk labels.
diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c
index 8e7707e..50fadfd 100644
--- a/libparted/labels/dos.c
+++ b/libparted/labels/dos.c
@@ -1696,8 +1696,7 @@ _align_primary (PedPartition* part, const PedCHSGeometry* bios_geom,
_primary_start_constraint (disk, part,
bios_geom, min_geom)));
- if (!solution)
- solution = _best_solution (part, bios_geom, solution,
+ solution = _best_solution (part, bios_geom, solution,
_try_constraint (part, constraint,
_primary_constraint (disk, bios_geom,
min_geom)));
commit 433526904ae5fdfe4b447eb167a5b005f06f0113
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Mon Apr 23 16:00:54 2007 -0400
Fix off-by-one bug in parted when displaying information about the disk label (the disk size, specifically).
diff --git a/parted/parted.c b/parted/parted.c
index 203358b..3c4aedd 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1251,6 +1251,7 @@ partition_print (PedPartition* part)
static int
do_print (PedDevice** dev)
{
+ PedUnit default_unit;
PedDisk* disk;
Table* table;
StrList* row;
@@ -1337,11 +1338,13 @@ do_print (PedDevice** dev)
}
start = ped_unit_format (*dev, 0);
+ default_unit = ped_unit_get_default ();
end = ped_unit_format_byte (*dev, (*dev)->length * (*dev)->sector_size
- - 1 );
-
+ - (default_unit == PED_UNIT_CHS ||
+ default_unit == PED_UNIT_CYLINDER));
+
if (opt_machine_mode) {
- switch (ped_unit_get_default ()) {
+ switch (default_unit) {
case PED_UNIT_CHS: puts ("CHS;");
break;
case PED_UNIT_CYLINDER: puts ("CYL;");
commit 0757137981e4ae47ed5e91413e526478c7ab1770
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Mon Apr 23 15:58:03 2007 -0400
Do not translate partition names in 'parted print' command. This causes problems for non-Latin-based character sets. Also, we don't want to translate the partition name here as we are just showing what is in the disklabel, translating it distorts what the value is.
Also added some malloc checks in table.c.
diff --git a/parted/parted.c b/parted/parted.c
index 37ed053..203358b 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1454,8 +1454,7 @@ do_print (PedDevice** dev)
if (!(part->type & PED_PARTITION_FREESPACE)) {
if (has_extended) {
- name =
- _(ped_partition_type_get_name (part->type));
+ name = ped_partition_type_get_name (part->type);
str_list_append (row, name);
}
@@ -1463,7 +1462,7 @@ do_print (PedDevice** dev)
part->fs_type->name : "");
if (has_name) {
- name = _(ped_partition_get_name (part));
+ name = ped_partition_get_name (part);
str_list_append (row, name);
}
diff --git a/parted/table.c b/parted/table.c
index 3b89e6d..c44db10 100644
--- a/parted/table.c
+++ b/parted/table.c
@@ -184,14 +184,15 @@ static void table_render_row (Table* t, int rownum, int ncols, wchar_t** s)
assert(t);
assert(s != NULL);
-
+
for (i = 0; i < ncols; ++i)
len += t->widths[i] + wcslen(DELIMITER);
len += wcslen(COLSUFFIX);
newsize = (wcslen(*s) + len + 1) * sizeof(wchar_t);
- *s = realloc (*s, newsize);
+ *s = (wchar_t *) realloc (*s, newsize);
+ assert(*s != NULL);
for (i = 0; i < ncols; ++i)
{
@@ -199,6 +200,7 @@ static void table_render_row (Table* t, int rownum, int ncols, wchar_t** s)
int nspaces = max(t->widths[i] - wcswidth(row[i], MAX_WIDTH),
0);
wchar_t* pad = malloc ( (nspaces + 1) * sizeof(wchar_t) );
+ assert(pad != NULL);
for (j = 0; j < nspaces; ++j)
pad[j] = L' ';
@@ -211,6 +213,7 @@ static void table_render_row (Table* t, int rownum, int ncols, wchar_t** s)
wcscat (*s, DELIMITER);
free (pad);
+ pad = NULL;
}
wcscat (*s, COLSUFFIX);
commit 75f5b27a41f59441c7bcaf14d8015a247bb44d66
Author: David Cantrell <dcantrel at mortise.boston.redhat.com>
Date: Mon Apr 23 15:53:48 2007 -0400
Remove unused label.
diff --git a/libparted/fs/linux_swap/linux_swap.c b/libparted/fs/linux_swap/linux_swap.c
index a8e95fd..3dd3780 100644
--- a/libparted/fs/linux_swap/linux_swap.c
+++ b/libparted/fs/linux_swap/linux_swap.c
@@ -121,7 +121,7 @@ _generic_swap_probe (PedGeometry* geom, int kind)
error_close_fs:
swap_close (fs);
-error:
+
return NULL;
}
commit a251a6ba52a5738590c2a2fe58e1f60ca6ba057c
Author: David Cantrell <dcantrell at redhat.com>
Date: Thu Mar 15 12:53:35 2007 -0400
Reverted my patch to configure.ac to remove -Wl,--as-needed from LDFLAGS when checking for libreadline.
diff --git a/configure.ac b/configure.ac
index 92a8e80..313a0f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -308,8 +308,6 @@ dnl NOTE: We need to remove the gl_cv_ignore_unused_libraries flag if we
dnl detected one earlier. libreadline on some platforms (e.g., RHEL and
dnl Fedora) is left with
if test "$with_readline" = yes; then
- OLD_LDFLAGS="$LDFLAGS"
- LDFLAGS="$(echo $LDFLAGS | sed -e 's/-Wl,--as-needed//g' | sed -e 's/-Wl,-z,ignore//g' | sed -e 's/-z\ ignore//g')"
OLD_LIBS="$LIBS"
LIBS="$LIBS $PARTED_LIBS"
AC_CHECK_LIB(readline, readline,
@@ -327,7 +325,6 @@ package as well (which may be called readline-devel or something similar).
$PARTED_LIBS
)
LIBS="$OLD_LIBS"
- LDFLAGS="$OLD_LDFLAGS"
fi
AC_SUBST(PARTED_LIBS)
@@ -463,13 +460,10 @@ dnl NOTE: We need to remove the gl_cv_ignore_unused_libraries flag if we
dnl detected one earlier. libreadline on some platforms (e.g., RHEL and
dnl Fedora) is left with
if test "$with_readline" = yes; then
- OLD_LDFLAGS="$LDFLAGS"
- LDFLAGS="$(echo $LDFLAGS | sed -e 's/-Wl,--as-needed//g' | sed -e 's/-Wl,-z,ignore//g' | sed -e 's/-z\ ignore//g')"
OLD_LIBS="$LIBS"
LIBS="$LIBS $PARTED_LIBS -lreadline"
AC_CHECK_FUNCS(rl_completion_matches)
LIBS="$OLD_LIBS"
- LDFLAGS="$OLD_LDFLAGS"
fi
AC_CHECK_FUNCS(canonicalize_file_name)
commit ef9e76ee4d34903e22966c31433564c08e5cf14f
Author: David Cantrell <dcantrell at redhat.com>
Date: Wed Mar 14 14:55:49 2007 -0400
libreadline is a problematic library. Autoconf adds a block to the generated configure script that checks to see if we should be passing the --as-needed flag to ld(1). There are portability reasons this code exists (best I can figure), but it presents a problem when we scan for libreadline.
libreadline specifically has unresolved symbols on at least Fedora and RHEL. Why? Well, the developer can choose to provide libtermcap, libncurses, or libncursesw (wide-char support) at compile time which all satisfy the curses API dependency that libreadline has. When the parted configure script runs, it fails on readline because the --as-needed flag causes the linker to not include libncurses even though we already have that on the link line.
My solution is to remove the --as-needed flag when we scan for libreadline and then later check for rl_completion_matches() in libreadline.
diff --git a/configure.ac b/configure.ac
index 86adcf4..92a8e80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -304,7 +304,12 @@ Note: (n)curses also seems to work as a substitute for termcap. This was
fi
dnl Check for readline
+dnl NOTE: We need to remove the gl_cv_ignore_unused_libraries flag if we
+dnl detected one earlier. libreadline on some platforms (e.g., RHEL and
+dnl Fedora) is left with
if test "$with_readline" = yes; then
+ OLD_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$(echo $LDFLAGS | sed -e 's/-Wl,--as-needed//g' | sed -e 's/-Wl,-z,ignore//g' | sed -e 's/-z\ ignore//g')"
OLD_LIBS="$LIBS"
LIBS="$LIBS $PARTED_LIBS"
AC_CHECK_LIB(readline, readline,
@@ -322,6 +327,7 @@ package as well (which may be called readline-devel or something similar).
$PARTED_LIBS
)
LIBS="$OLD_LIBS"
+ LDFLAGS="$OLD_LDFLAGS"
fi
AC_SUBST(PARTED_LIBS)
@@ -453,11 +459,17 @@ dnl Checks for library functions.
AC_CHECK_FUNCS(sigaction)
AC_CHECK_FUNCS(getuid)
+dnl NOTE: We need to remove the gl_cv_ignore_unused_libraries flag if we
+dnl detected one earlier. libreadline on some platforms (e.g., RHEL and
+dnl Fedora) is left with
if test "$with_readline" = yes; then
+ OLD_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$(echo $LDFLAGS | sed -e 's/-Wl,--as-needed//g' | sed -e 's/-Wl,-z,ignore//g' | sed -e 's/-z\ ignore//g')"
OLD_LIBS="$LIBS"
LIBS="$LIBS $PARTED_LIBS -lreadline"
AC_CHECK_FUNCS(rl_completion_matches)
LIBS="$OLD_LIBS"
+ LDFLAGS="$OLD_LDFLAGS"
fi
AC_CHECK_FUNCS(canonicalize_file_name)
commit 981dfe2a465d6263cfcba8febf0ba87c521d0ab3
Author: David Cantrell <dcantrell at redhat.com>
Date: Tue Mar 13 15:05:53 2007 -0400
More changes to set the version number to 1.8.3.
diff --git a/NEWS b/NEWS
index 85113a7..5a4fb64 100644
--- a/NEWS
+++ b/NEWS
@@ -1,26 +1,5 @@
-1.8.0
+1.8.3
=====
libparted:
-* GPT fixes:
- - Correctly handle disks with non-512 byte sector sizes
- - Support LUN resizing (see new space, allow parted to use it)
- - Prevent overlap of LastUsableLBA and PartitionEntryLBA in backup GPT
-* Prevent SIGFPE when FAT sector size is 0
-* Add ped_exception_get_handler()
-* DASD support for IBM zSeries systems
-* AIX disk label support
-* Detect Promise SX8 storage devices
-* Macintosh (ppc and x86) disk label improvements:
- - Prevent LVM and RAID partition types from corrupting the table
- - Fix removal of driver partition
-* Add support binary units (MiB, KiB, GiB)
-* In ped_register_disk_type(), handle disk_types==NULL case
-* In ped_unregister_disk_type(), handle case where type is not registered
-* Fix geometry read problems on 64-bit Macs (and probably other 64-bit systems)
-* Add support for /dev/mapper devices via libdevmapper library
-* Detect Apple_Boot partition types correctly on MacOS X 10.4 systems
parted:
-* Various bug fixes, signal handling fixes, and spelling error fixes
-* UI improvements to display more information about the disk and transport
- layer
diff --git a/configure.ac b/configure.ac
index 1655879..86adcf4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ dnl
dnl This file may be modified and/or distributed without restriction.
AC_PREREQ(2.61)
-AC_INIT([GNU parted],[1.9.9],[bug-parted at gnu.org])
+AC_INIT([GNU parted],[1.8.3],[bug-parted at gnu.org])
AC_CONFIG_SRCDIR(include/parted/parted.h)
commit 3e456114e07fd03e58b7a74c2c9bbafb4812858e
Author: David Cantrell <dcantrell at redhat.com>
Date: Tue Mar 13 13:03:02 2007 -0400
Set version to 1.8.3 for upcoming release.
diff --git a/configure.ac b/configure.ac
index 9401d46..1655879 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,10 +23,10 @@ dnl if backwards compatibility has been broken (eg. functions removed,
dnl function signatures changed),
dnl set PED_BINARY_AGE _and_ PED_INTERFACE_AGE to 0.
PED_MAJOR_VERSION=1
-PED_MINOR_VERSION=9
-PED_MICRO_VERSION=9
-PED_INTERFACE_AGE=1
-PED_BINARY_AGE=1
+PED_MINOR_VERSION=8
+PED_MICRO_VERSION=3
+PED_INTERFACE_AGE=0
+PED_BINARY_AGE=0
PED_VERSION_SUFFIX=
PED_VERSION=$PED_MAJOR_VERSION.$PED_MINOR_VERSION.$PED_MICRO_VERSION$PED_VERSION_SUFFIX
diff --git a/parted.lsm b/parted.lsm
index 6443514..23ff2b3 100644
--- a/parted.lsm
+++ b/parted.lsm
@@ -1,6 +1,6 @@
Begin4
Title: parted
-Version: 1.8.0
+Version: 1.8.3
Entered-date:
Description: GNU Parted is a program for creating, destroying, resizing,
checking and copying partitions, and the filesystems on them. This is useful for
@@ -10,8 +10,8 @@ Keywords: partition, partitioning, file system, format, hard disk, storage, disk
Author: <clausen at gnu.org> (Andrew Clausen)
Maintained-by: <parted-devel at lists.alioth.debian.org> (GNU Parted development team)
Primary-site: ftp://ftp.gnu.org/gnu/parted
-1.1M parted-1.8.0.tar.bz2
-1.7M parted-1.8.0.tar.gz
+1.1M parted-1.8.3.tar.bz2
+1.7M parted-1.8.3.tar.gz
Platforms: Linux, FreeBSD, BeOS; compiles with GCC and probably other C99 compilers.
Copying-policy: GPL
End
More information about the Parted-commits
mailing list