version 1.6.2.1, 2014/02/06 00:00:18
|
version 1.6.2.4, 2014/02/06 01:23:56
|
Line 92 EmptyStore(int img)
|
Line 92 EmptyStore(int img)
|
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, bufSize)) == -1 || |
if ((wlen = write(img, buf, bufSize)) == -1 || |
(wlen && wlen != bufSize)) { |
(wlen && wlen != bufSize)) { |
EERROR(EIO, "Error at chunk %d init %d bytes, " | if (wlen == -1) |
"should be %u\n", i, wlen, bufSize); | ESYSERR(0); |
| else |
| EERROR(EIO, "Error at chunk %d init %d bytes, " |
| "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 123 FillStore(int img, int fd)
|
Line 126 FillStore(int img, int fd)
|
else |
else |
VERB(1) printf("+Readed %d bytes for chunk #%d\n", rlen, j); |
VERB(1) printf("+Readed %d bytes for chunk #%d\n", rlen, j); |
|
|
wlen = write(img, buf, rlen); | wlen = write(img, buf, bufSize); |
if (wlen == -1) { |
if (wlen == -1) { |
ESYSERR(0); |
ESYSERR(0); |
return -1; |
return -1; |
} else if (wlen && wlen != rlen) { | } else if (wlen && wlen != bufSize) { |
EERROR(EIO, "Readed %d bytes are not equal to written %d bytes\n", | EERROR(EIO, "Error at chunk %d written %d bytes, " |
rlen, wlen); | "should be %u\n", i, wlen, bufSize); |
} else |
} else |
VERB(1) printf("+Written %d bytes at chunk #%d\n", wlen, i); |
VERB(1) printf("+Written %d bytes at chunk #%d\n", wlen, i); |
} |
} |
Line 158 main(int argc, char **argv)
|
Line 161 main(int argc, char **argv)
|
case 't': |
case 't': |
tr = O_TRUNC; |
tr = O_TRUNC; |
break; |
break; |
case 'g': |
|
m = 1; |
|
break; |
|
case 'p': |
case 'p': |
bufSize = IMGBUF_SIZE2; |
bufSize = IMGBUF_SIZE2; |
break; |
break; |
|
case 'g': |
|
m = 1; |
case 'i': |
case 'i': |
fromBegin = 1; |
fromBegin = 1; |
break; |
break; |
Line 272 main(int argc, char **argv)
|
Line 274 main(int argc, char **argv)
|
return 4; |
return 4; |
} |
} |
} else { /* GET */ |
} else { /* GET */ |
|
iSize ^= iSize; |
if (EmptyStore(fd) == -1) { |
if (EmptyStore(fd) == -1) { |
if (fd > 2) |
if (fd > 2) |
close(fd); |
close(fd); |