diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-09-16 21:08:06 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-09-16 21:08:06 +0000 |
commit | 5fafdf24ef2c090c164d4dc89684b3f379dbdd87 (patch) | |
tree | c0654ee63b6dac76d98b427e92ef16850a90c652 /block-cloop.c | |
parent | bd494f4cbd4187dda8cc8f4739763f24a31a4c8b (diff) |
find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-cloop.c')
-rw-r--r-- | block-cloop.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/block-cloop.c b/block-cloop.c index f51c32d1bd..4dfe766b77 100644 --- a/block-cloop.c +++ b/block-cloop.c @@ -1,8 +1,8 @@ /* * QEMU Block driver for CLOOP images - * + * * Copyright (c) 2004 Johannes E. Schindelin - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -96,7 +96,7 @@ cloop_close: if(inflateInit(&s->zstream) != Z_OK) goto cloop_close; s->current_block=s->n_blocks; - + s->sectors_per_block = s->block_size/512; bs->total_sectors = s->n_blocks*s->sectors_per_block; return 0; @@ -107,12 +107,12 @@ static inline int cloop_read_block(BDRVCloopState *s,int block_num) if(s->current_block != block_num) { int ret; uint32_t bytes = s->offsets[block_num+1]-s->offsets[block_num]; - + lseek(s->fd, s->offsets[block_num], SEEK_SET); ret = read(s->fd, s->compressed_block, bytes); - if (ret != bytes) + if (ret != bytes) return -1; - + s->zstream.next_in = s->compressed_block; s->zstream.avail_in = bytes; s->zstream.next_out = s->uncompressed_block; @@ -123,13 +123,13 @@ static inline int cloop_read_block(BDRVCloopState *s,int block_num) ret = inflate(&s->zstream, Z_FINISH); if(ret != Z_STREAM_END || s->zstream.total_out != s->block_size) return -1; - + s->current_block = block_num; } return 0; } -static int cloop_read(BlockDriverState *bs, int64_t sector_num, +static int cloop_read(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors) { BDRVCloopState *s = bs->opaque; |