|
|
| version 1.3.2.2, 2014/02/05 22:51:25 | version 1.6, 2014/02/05 23:31:55 |
|---|---|
| Line 86 EmptyStore(int img) | Line 86 EmptyStore(int img) |
| memset(buf, 0, sizeof buf); | memset(buf, 0, sizeof buf); |
| for (i = howmany(iSize, bufSize); i < howmany(imgSize, bufSize); i++) | for (i = howmany(iSize, bufSize); i < howmany(imgSize, bufSize); i++) |
| if ((wlen = write(img, buf, sizeof buf)) == -1 || | if ((wlen = write(img, buf, bufSize)) == -1 || |
| wlen != sizeof buf) { | (wlen && wlen != bufSize)) { |
| EERROR(EIO, "Error at chunk %d init %d bytes, should be %u\n", | EERROR(EIO, "Error at chunk %d init %d bytes, " |
| i, wlen, sizeof buf); | "should be %u\n", i, wlen, bufSize); |
| return -1; | return -1; |
| } else | } else |
| VERB(1) printf("+Written chunk #%d\n", i); | VERB(1) printf("+Written chunk #%d\n", i); |
| Line 110 FillStore(int img, int fd) | Line 110 FillStore(int img, int fd) |
| for (j = 0, i = howmany(iSize, bufSize); i < howmany(imgSize, bufSize); | for (j = 0, i = howmany(iSize, bufSize); i < howmany(imgSize, bufSize); |
| i++, j++) { | i++, j++) { |
| memset(buf, 0, sizeof buf); | memset(buf, 0, sizeof buf); |
| rlen = read(fd, buf, sizeof buf); | rlen = read(fd, buf, bufSize); |
| if (rlen == -1) { | if (rlen == -1) { |
| ESYSERR(0); | ESYSERR(0); |
| return -1; | return -1; |
| Line 123 FillStore(int img, int fd) | Line 123 FillStore(int img, int fd) |
| if (wlen == -1) { | if (wlen == -1) { |
| ESYSERR(0); | ESYSERR(0); |
| return -1; | return -1; |
| } else if (!wlen || wlen != rlen) { | } else if (wlen && wlen != rlen) { |
| EERROR(EIO, "Readed %d bytes are not equal to written %d bytes\n", | EERROR(EIO, "Readed %d bytes are not equal to written %d bytes\n", |
| rlen, wlen); | rlen, wlen); |
| } else | } else |