--- libldm-0.2.3/src/Makefile.am.orig 2012-09-20 12:31:03.000000000 +0200 +++ libldm-0.2.3/src/Makefile.am 2013-01-07 19:20:40.782494058 +0100 @@ -15,7 +15,7 @@ # along with this program. If not, see . AM_CFLAGS = -Wall -Werror -Wshadow -Wextra \ - -Wno-unused-local-typedefs \ + -Wno-missing-field-initializers \ -Wno-unused-parameter libname = libldm-1.0.la --- libldm-0.2.3/src/mbr.c.orig 2012-07-23 17:47:49.000000000 +0200 +++ libldm-0.2.3/src/mbr.c 2013-01-07 19:20:16.992494554 +0100 @@ -47,13 +47,13 @@ { struct _mbr _mbr; - size_t read = 0; - while (read < sizeof(_mbr)) { - ssize_t in = pread(fd, &_mbr + read, sizeof(struct _mbr) - read, read); + size_t nread = 0; + while (nread < sizeof(_mbr)) { + ssize_t in = pread(fd, &_mbr + nread, sizeof(struct _mbr) - nread, nread); if (in == 0) return -MBR_ERROR_INVALID; if (in == -1) return -MBR_ERROR_READ; - read += in; + nread += in; } if (_mbr.magic[0] != 0x55 || _mbr.magic[1] != 0xAA) --- libldm-0.2.3/src/gpt.c.orig 2012-09-20 12:31:03.000000000 +0200 +++ libldm-0.2.3/src/gpt.c 2013-01-07 19:29:04.812483553 +0100 @@ -82,14 +82,14 @@ const off_t gpt_start = secsize; struct _gpt_head head; - size_t read = 0; - while (read < sizeof(head)) { - ssize_t in = pread(fd, &head + read, sizeof(head) - read, - read + gpt_start); + size_t nread = 0; + while (nread < sizeof(head)) { + ssize_t in = pread(fd, &head + nread, sizeof(head) - nread, + nread + gpt_start); if (in == 0) return -GPT_ERROR_INVALID; if (in == -1) return -GPT_ERROR_READ; - read += in; + nread += in; } if (memcmp(head.magic, "EFI PART", 8) != 0) return -GPT_ERROR_INVALID; @@ -111,9 +111,9 @@ struct _gpt *_gpt = (*h)->gpt; memcpy(_gpt, &head, sizeof(head)); - while (read < le32toh(head.size)) { - ssize_t in = pread(fd, (char *)(_gpt) + read, le32toh(head.size) - read, - read + gpt_start); + while (nread < le32toh(head.size)) { + ssize_t in = pread(fd, (char *)(_gpt) + nread, le32toh(head.size) - nread, + nread + gpt_start); if (in == 0) { err = -GPT_ERROR_INVALID; goto error; @@ -123,7 +123,7 @@ goto error; } - read += in; + nread += in; } uint32_t header_crc = _gpt->header_crc; @@ -151,10 +151,10 @@ if ((*h)->pte_array == NULL) abort(); const off_t pte_array_start = _gpt->pte_array_start_lba * secsize; - read = 0; - while (read < pte_array_size) { - ssize_t in = pread(fd, (*h)->pte_array + read, pte_array_size - read, - read + pte_array_start); + nread = 0; + while (nread < pte_array_size) { + ssize_t in = pread(fd, (*h)->pte_array + nread, pte_array_size - nread, + nread + pte_array_start); if (in == 0) { err = -GPT_ERROR_INVALID; goto error; @@ -164,7 +164,7 @@ goto error; } - read += in; + nread += in; } crc = crc32(0L, Z_NULL, 0); --- libldm-0.2.3/src/ldm.c.orig 2012-09-21 12:21:17.000000000 +0200 +++ libldm-0.2.3/src/ldm.c 2013-01-07 19:31:35.259147085 +0100 @@ -1170,15 +1170,15 @@ void ** const config, GError ** const err) { /* Sanity check ldm_config_start and ldm_config_size */ - struct stat stat; - if (fstat(fd, &stat) == -1) { + struct stat sstat; + if (fstat(fd, &sstat) == -1) { g_set_error(err, LDM_ERROR, LDM_ERROR_IO, "Unable to stat %s: %m", path); return FALSE; } - uint64_t size = stat.st_size; - if (S_ISBLK(stat.st_mode)) { + uint64_t size = sstat.st_size; + if (S_ISBLK(sstat.st_mode)) { if (ioctl(fd, BLKGETSIZE64, &size) == -1) { g_set_error(err, LDM_ERROR, LDM_ERROR_IO, "Unable to get block device size for %s: %m", path); @@ -1205,10 +1205,10 @@ } *config = g_malloc(config_size); - size_t read = 0; - while (read < config_size) { - ssize_t in = pread(fd, *config + read, config_size - read, - config_start + read); + size_t nread = 0; + while (nread < config_size) { + ssize_t in = pread(fd, *config + nread, config_size - nread, + config_start + nread); if (in == 0) { g_set_error(err, LDM_ERROR, LDM_ERROR_INVALID, "%s contains invalid LDM metadata", path); @@ -1221,7 +1221,7 @@ goto error; } - read += in; + nread += in; } return TRUE; @@ -1236,11 +1236,11 @@ const uint64_t ph_start, struct _privhead * const privhead, GError **err) { - size_t read = 0; - while (read < sizeof(*privhead)) { - ssize_t in = pread(fd, (char *) privhead + read, - sizeof(*privhead) - read, - ph_start + read); + size_t nread = 0; + while (nread < sizeof(*privhead)) { + ssize_t in = pread(fd, (char *) privhead + nread, + sizeof(*privhead) - nread, + ph_start + nread); if (in == 0) { g_set_error(err, LDM_ERROR, LDM_ERROR_INVALID, "%s contains invalid LDM metadata", path); @@ -1253,7 +1253,7 @@ return FALSE; } - read += in; + nread += in; } if (memcmp(privhead->magic, "PRIVHEAD", 8) != 0) {