Changeset 58898d1d in mainline for uspace/drv/bus/isa/isa.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/drv/bus/isa/isa.c

    rc9e3692 r58898d1d  
    254254        size_t len;
    255255        ssize_t r;
     256        struct stat st;
    256257
    257258        fd = open(conf_path, O_RDONLY);
     
    263264        opened = true;
    264265
    265         len = lseek(fd, 0, SEEK_END);
    266         lseek(fd, 0, SEEK_SET);
     266        if (fstat(fd, &st) != EOK) {
     267                ddf_msg(LVL_ERROR, "Unable to fstat %d", fd);
     268                goto cleanup;
     269        }
     270
     271        len = st.size;
    267272        if (len == 0) {
    268273                ddf_msg(LVL_ERROR, "Configuration file '%s' is empty.",
     
    277282        }
    278283
    279         r = read(fd, buf, len);
     284        r = read(fd, (aoff64_t []) {0}, buf, len);
    280285        if (r < 0) {
    281286                ddf_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path);
Note: See TracChangeset for help on using the changeset viewer.