Changeset 58898d1d in mainline for uspace/lib/bithenge/src/file.c


Ignore:
Timestamp:
2017-03-24T20:31:54Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8e9b2534
Parents:
c9e3692
Message:

Remove VFS_IN_SEEK from VFS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/bithenge/src/file.c

    rc9e3692 r58898d1d  
    7878        if (offset > blob->size)
    7979                return ELIMIT;
    80         if (lseek(blob->fd, offset, SEEK_SET) < 0)
    81                 return errno == EINVAL ? EIO : errno;
    8280
    83         ssize_t amount_read;
    84         aoff64_t remaining_size = *size;
    85         *size = 0;
    86         do {
    87                 amount_read = read(blob->fd, buffer, remaining_size);
    88                 if (amount_read < 0)
    89                         return errno;
    90                 buffer += amount_read;
    91                 *size += amount_read;
    92                 remaining_size -= amount_read;
    93         } while (remaining_size && amount_read);
     81        ssize_t amount_read = read(blob->fd, &offset, buffer, *size);
     82        if (amount_read < 0)
     83                return errno;
     84        *size += amount_read;
    9485        return EOK;
    9586}
Note: See TracChangeset for help on using the changeset viewer.