summaryrefslogtreecommitdiff
path: root/partx
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@gnu.org>2010-10-07 10:48:28 -0400
committerKarel Zak <kzak@redhat.com>2010-10-08 10:56:28 +0200
commit4f1509b96935ee61c618b5b26a0ed5defa74b204 (patch)
tree26cc2becc337fbdee980f626194a3d327c3d9d5c /partx
parentaadd32ea8e570af2ae4a76926b97b496b8187d57 (diff)
downloadutil-linux-old-4f1509b96935ee61c618b5b26a0ed5defa74b204.tar.gz
partx: integrate support for mac and sun partitions, based on kpartx.
[kzak@redhat.com: - remove unnecessary members from struct slice, - fix gcc warnings] Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'partx')
-rw-r--r--partx/Makefile.am2
-rw-r--r--partx/mac.c2
-rw-r--r--partx/partx.c2
-rw-r--r--partx/partx.h1
-rw-r--r--partx/sun.c6
5 files changed, 6 insertions, 7 deletions
diff --git a/partx/Makefile.am b/partx/Makefile.am
index 36163aa9..a26963ed 100644
--- a/partx/Makefile.am
+++ b/partx/Makefile.am
@@ -3,7 +3,7 @@ include $(top_srcdir)/config/include-Makefile.am
if BUILD_PARTX
usrsbin_exec_PROGRAMS = addpart delpart partx
-partx_SOURCES = bsd.c dos.c partx.c solaris.c unixware.c gpt.c crc32.c \
+partx_SOURCES = bsd.c dos.c partx.c solaris.c unixware.c sun.c mac.c gpt.c crc32.c \
efi.h gpt.h crc32.h partx.h dos.h $(top_srcdir)/lib/blkdev.c
if LINUX
diff --git a/partx/mac.c b/partx/mac.c
index ed4ed9b9..a5677f01 100644
--- a/partx/mac.c
+++ b/partx/mac.c
@@ -36,7 +36,7 @@ read_mac_pt(int fd, struct slice all, struct slice *sp, int ns) {
struct mac_driver_desc *md;
struct mac_partition *part;
unsigned secsize;
- char *data;
+ unsigned char *data;
int blk, blocks_in_map;
int n = 0;
diff --git a/partx/partx.c b/partx/partx.c
index 14d2609f..aa5a2ad8 100644
--- a/partx/partx.c
+++ b/partx/partx.c
@@ -83,6 +83,8 @@ initpts(void)
addpts("bsd", read_bsd_pt);
addpts("solaris", read_solaris_pt);
addpts("unixware", read_unixware_pt);
+ addpts("sun", read_sun_pt);
+ addpts("mac", read_mac_pt);
}
static char short_opts[] = "ladgvn:t:";
diff --git a/partx/partx.h b/partx/partx.h
index d98d77a4..8702f259 100644
--- a/partx/partx.h
+++ b/partx/partx.h
@@ -20,6 +20,7 @@ struct slice {
typedef int (ptreader)(int fd, struct slice all, struct slice *sp, int ns);
extern ptreader read_dos_pt, read_bsd_pt, read_solaris_pt, read_unixware_pt, read_gpt_pt;
+extern ptreader read_sun_pt, read_mac_pt;
unsigned char *getblock(int fd, unsigned int secnr);
diff --git a/partx/sun.c b/partx/sun.c
index c8143686..30cbd9fb 100644
--- a/partx/sun.c
+++ b/partx/sun.c
@@ -68,7 +68,7 @@ read_sun_pt(int fd, struct slice all, struct slice *sp, int ns) {
struct sun_raw_part *s;
unsigned int offset = all.start, end;
int i, j, n;
- char *bp;
+ unsigned char *bp;
bp = getblock(fd, offset);
if (bp == NULL)
@@ -123,10 +123,6 @@ read_sun_pt(int fd, struct slice all, struct slice *sp, int ns) {
"sun_disklabel: slice %d overlaps with %d\n", i , j);
sp[i].size = 0;
}
- } else {
- if (end <= sp[j].start + sp[j].size) {
- sp[i].container = j + 1;
- }
}
}
}