[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] shared library version: increment major: 1.0.0
From: |
Jim Meyering |
Subject: |
[PATCH 1/3] shared library version: increment major: 1.0.0 |
Date: |
Mon, 30 May 2011 13:37:09 +0200 |
I expect to release parted-3.0 today.
The main change is the removal of all FS-related UI and functions.
See the details in NEWS:
http://git.savannah.gnu.org/cgit/parted.git/tree/NEWS
The interface deletions mean libparted's shared library major
version number must be incremented.
That's the first change below.
The other two address coverity-spotted issues,
neither of which is a big deal.
>From 1fa00f7ff6a96063abdf9512ddc16781bb3e2291 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 30 May 2011 12:40:59 +0200
Subject: [PATCH 1/3] shared library version: increment major: 1.0.0
* libparted/Makefile.am (CURRENT, REVISION): Update from 0.2.0 to 1.0.0,
due to removed interfaces.
---
libparted/Makefile.am | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libparted/Makefile.am b/libparted/Makefile.am
index dce96b7..0a8923e 100644
--- a/libparted/Makefile.am
+++ b/libparted/Makefile.am
@@ -24,8 +24,8 @@ lib_LTLIBRARIES = libparted.la
# Set the shared library version, per Libtool's guidelines.
# For details, see the "Updating library version information" section of
# "info libtool".
-CURRENT = 0
-REVISION = 2
+CURRENT = 1
+REVISION = 0
AGE = 0
libparted_la_LDFLAGS = -version-info $(CURRENT):$(REVISION):$(AGE)
--
1.7.5.2.660.g9f46c
>From 5e3897f35041c16fd58fc11ed603d8fc0b44736c Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 30 May 2011 12:49:21 +0200
Subject: [PATCH 2/3] loop: avoid NULL dereference upon failure
* libparted/labels/loop.c (loop_partition_duplicate): Don't dereference
NULL upon failure.
---
libparted/labels/loop.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libparted/labels/loop.c b/libparted/labels/loop.c
index c0f0979..9053b17 100644
--- a/libparted/labels/loop.c
+++ b/libparted/labels/loop.c
@@ -203,6 +203,8 @@ loop_partition_duplicate (const PedPartition* part)
result = ped_partition_new (part->disk, part->type, part->fs_type,
part->geom.start, part->geom.end);
+ if (result == NULL)
+ return NULL;
result->num = part->num;
return result;
}
--
1.7.5.2.660.g9f46c
>From 24e337d5fb734d64000058f58fbdd6ffe2a0a90e Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 30 May 2011 13:09:01 +0200
Subject: [PATCH 3/3] maint: placate coverity: don't ignore some return values
* libparted/cs/constraint.c: Include <assert.h>.
(ped_constraint_exact): Don't ignore ped_alignment_init's return
value or that from ped_geometry_init.
---
libparted/cs/constraint.c | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/libparted/cs/constraint.c b/libparted/cs/constraint.c
index f4181c5..e0f4c4d 100644
--- a/libparted/cs/constraint.c
+++ b/libparted/cs/constraint.c
@@ -46,6 +46,7 @@
#include <config.h>
#include <parted/parted.h>
#include <parted/debug.h>
+#include <assert.h>
/**
* Initializes a pre-allocated piece of memory to contain a constraint
@@ -511,11 +512,20 @@ ped_constraint_exact (const PedGeometry* geom)
PedAlignment end_align;
PedGeometry start_sector;
PedGeometry end_sector;
-
- ped_alignment_init (&start_align, geom->start, 0);
- ped_alignment_init (&end_align, geom->end, 0);
- ped_geometry_init (&start_sector, geom->dev, geom->start, 1);
- ped_geometry_init (&end_sector, geom->dev, geom->end, 1);
+ int ok;
+
+ /* With grain size of 0, it always succeeds. */
+ ok = ped_alignment_init (&start_align, geom->start, 0);
+ assert (ok);
+ ok = ped_alignment_init (&end_align, geom->end, 0);
+ assert (ok);
+
+ ok = ped_geometry_init (&start_sector, geom->dev, geom->start, 1);
+ if (!ok)
+ return NULL;
+ ok = ped_geometry_init (&end_sector, geom->dev, geom->end, 1);
+ if (!ok)
+ return NULL;
return ped_constraint_new (&start_align, &end_align,
&start_sector, &end_sector, 1,
--
1.7.5.2.660.g9f46c
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 1/3] shared library version: increment major: 1.0.0,
Jim Meyering <=