summaryrefslogtreecommitdiff
path: root/usr/src/cmd/boot/installgrub/installgrub.c
diff options
context:
space:
mode:
authorSharath M Srinivasan <Sharath.Srinivasan@Sun.COM>2009-12-04 11:52:47 +0530
committerSharath M Srinivasan <Sharath.Srinivasan@Sun.COM>2009-12-04 11:52:47 +0530
commit6cb5747b0a5bbfb2ecd674b4887034dbb1874391 (patch)
treeeb1cad54aa85ca312afda4a9385cae10dd2791a4 /usr/src/cmd/boot/installgrub/installgrub.c
parentc0da627439dfb642fb41ab7d78406fc69d2c64b2 (diff)
downloadillumos-joyent-6cb5747b0a5bbfb2ecd674b4887034dbb1874391.tar.gz
6894057 cmd format Failed to initialize libfdisk
Diffstat (limited to 'usr/src/cmd/boot/installgrub/installgrub.c')
-rw-r--r--usr/src/cmd/boot/installgrub/installgrub.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/cmd/boot/installgrub/installgrub.c b/usr/src/cmd/boot/installgrub/installgrub.c
index ed552b44ce..6a60554e1b 100644
--- a/usr/src/cmd/boot/installgrub/installgrub.c
+++ b/usr/src/cmd/boot/installgrub/installgrub.c
@@ -311,13 +311,15 @@ get_start_sector(int fd)
*/
if ((rval = libfdisk_init(&epp, device_p0, NULL, FDISK_READ_DISK))
!= FDISK_SUCCESS) {
+ libfdisk_fini(&epp);
switch (rval) {
/*
- * The first 2 cases are not an error per-se, just that
+ * The first 3 cases are not an error per-se, just that
* there is no Solaris logical partition
*/
case FDISK_EBADLOGDRIVE:
case FDISK_ENOLOGDRIVE:
+ case FDISK_EBADMAGIC:
(void) fprintf(stderr, NOSOLPAR);
exit(-1);
/*NOTREACHED*/
@@ -341,12 +343,12 @@ get_start_sector(int fd)
}
rval = fdisk_get_solaris_part(epp, &pno, &secnum, &numsec);
+ libfdisk_fini(&epp);
if (rval != FDISK_SUCCESS) {
/* No solaris logical partition */
(void) fprintf(stderr, NOSOLPAR);
exit(-1);
}
- libfdisk_fini(&epp);
start_sect = secnum;
partition = pno - 1;