Changeset 0c243b4 in mainline for uspace/lib/libblock/libblock.c
- Timestamp:
- 2008-11-02T10:32:42Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1ba5d6
- Parents:
- 6284978
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libblock/libblock.c
r6284978 r0c243b4 177 177 { 178 178 void *bb_buf; 179 int rc; 179 180 180 181 devcon_t *devcon = devcon_search(dev_handle); … … 189 190 off_t bufpos = 0; 190 191 size_t buflen = 0; 191 if (!block_read(dev_handle, &bufpos, &buflen, &off, 192 bb_buf, size, size)) { 192 rc = block_read(dev_handle, &bufpos, &buflen, &off, 193 bb_buf, size, size); 194 if (rc != EOK) { 193 195 free(bb_buf); 194 return EIO; /* XXX real error code */196 return rc; 195 197 } 196 198 devcon->bb_buf = bb_buf; … … 220 222 * @param block_size Block size to be used for the transfer. 221 223 * 222 * @return True on success, false on failure.224 * @return EOK on success or a negative return code on failure. 223 225 */ 224 bool 226 int 225 227 block_read(int dev_handle, off_t *bufpos, size_t *buflen, off_t *pos, void *dst, 226 228 size_t size, size_t block_size) … … 257 259 *pos / block_size, block_size, &retval); 258 260 if ((rc != EOK) || (retval != EOK)) 259 return false;261 return (rc != EOK ? rc : retval); 260 262 261 263 *bufpos = 0; … … 264 266 } 265 267 266 return true;268 return EOK; 267 269 } 268 270 … … 286 288 b->size = bs; 287 289 288 if ( !block_read(dev_handle, &bufpos, &buflen, &pos, b->data,289 bs, bs) ) {290 if (block_read(dev_handle, &bufpos, &buflen, &pos, b->data, 291 bs, bs) != EOK) { 290 292 free(b->data); 291 293 free(b);
Note:
See TracChangeset
for help on using the changeset viewer.