Changeset 58898d1d in mainline for uspace/srv/devman/match.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/srv/devman/match.c

    rc9e3692 r58898d1d  
    201201        int fd;
    202202        size_t len = 0;
     203        struct stat st;
    203204       
    204205        fd = open(conf_path, O_RDONLY);
     
    210211        opened = true;
    211212       
    212         len = lseek(fd, 0, SEEK_END);
    213         lseek(fd, 0, SEEK_SET);
     213        if (fstat(fd, &st) != EOK) {
     214                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to fstat %d: %s.", fd,
     215                    str_error(errno));
     216                goto cleanup;
     217        }
     218        len = st.size;
    214219        if (len == 0) {
    215220                log_msg(LOG_DEFAULT, LVL_ERROR, "Configuration file '%s' is empty.",
     
    225230        }
    226231       
    227         ssize_t read_bytes = read(fd, buf, len);
     232        ssize_t read_bytes = read(fd, (aoff64_t []) {0}, buf, len);
    228233        if (read_bytes <= 0) {
    229234                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s' (%d).", conf_path,
Note: See TracChangeset for help on using the changeset viewer.