Revision ecbe1576
b/block/bochs.c | ||
---|---|---|
146 | 146 |
bs->total_sectors = le64_to_cpu(bochs.extra.redolog.disk) / 512; |
147 | 147 |
} |
148 | 148 |
|
149 |
lseek(s->fd, le32_to_cpu(bochs.header), SEEK_SET); |
|
149 |
if (lseek(s->fd, le32_to_cpu(bochs.header), SEEK_SET) == (off_t)-1) { |
|
150 |
goto fail; |
|
151 |
} |
|
150 | 152 |
|
151 | 153 |
s->catalog_size = le32_to_cpu(bochs.extra.redolog.catalog); |
152 | 154 |
s->catalog_bitmap = qemu_malloc(s->catalog_size * 4); |
... | ... | |
197 | 199 |
// bitmap_offset, block_offset); |
198 | 200 |
|
199 | 201 |
// read in bitmap for current extent |
200 |
lseek(s->fd, bitmap_offset + (extent_offset / 8), SEEK_SET); |
|
202 |
if (lseek(s->fd, bitmap_offset + (extent_offset / 8), SEEK_SET) == |
|
203 |
(off_t)-1) { |
|
204 |
return -1; |
|
205 |
} |
|
201 | 206 |
|
202 | 207 |
if (read(s->fd, &bitmap_entry, 1) != 1) |
203 | 208 |
return -1; |
... | ... | |
209 | 214 |
return -1; // not allocated |
210 | 215 |
} |
211 | 216 |
|
212 |
lseek(s->fd, block_offset, SEEK_SET); |
|
217 |
if (lseek(s->fd, block_offset, SEEK_SET) == (off_t)-1) { |
|
218 |
return -1; |
|
219 |
} |
|
213 | 220 |
|
214 | 221 |
return 0; |
215 | 222 |
} |
Also available in: Unified diff