X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Flib%2Fgpt.c;h=d90ddaf235c072ffe3626c0f358345f1042a59d9;hb=438378f384ede73602fcdfd288e45ac41d933bb0;hp=85aefedd6711f7534f2a59dbd9d519673c7f0461;hpb=979416ca87e2c2c13870d48d9d42e14137186fa9;p=debian%2Fefibootmgr diff --git a/src/lib/gpt.c b/src/lib/gpt.c index 85aefed..d90ddaf 100644 --- a/src/lib/gpt.c +++ b/src/lib/gpt.c @@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define _FILE_OFFSET_BITS 64 - #include #include #include @@ -236,6 +234,7 @@ read_lba(int fd, uint64_t lba, void *buffer, size_t bytes) lseek(fd, offset, SEEK_SET); bytesread = read(fd, aligned, bytes); memcpy(buffer, aligned, bytesread); + free(unaligned); /* Kludge. This is necessary to read/write the last block of an odd-sized disk, until Linux 2.5.x kernel fixes. @@ -625,9 +624,8 @@ gpt_disk_get_partition_info(int fd, memcpy(signature, &p->unique_partition_guid, sizeof (p->unique_partition_guid)); } else { - *start = 0; - *size = last_lba(fd) + 1; - memcpy(signature, &gpt->disk_guid, sizeof (gpt->disk_guid)); + fprintf (stderr,"partition %d is not valid\n", num); + return 1; } return 0; }