Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/match.c

    rce04ea44 raed3e6a  
    3232
    3333#include <errno.h>
     34#include <fcntl.h>
    3435#include <io/log.h>
    3536#include <str.h>
    3637#include <str_error.h>
    3738#include <sys/types.h>
    38 #include <vfs/vfs.h>
     39#include <sys/stat.h>
    3940
    4041#include "devman.h"
     
    200201        int fd;
    201202        size_t len = 0;
    202         struct stat st;
    203        
    204         fd = vfs_lookup_open(conf_path, WALK_REGULAR, MODE_READ);
     203       
     204        fd = open(conf_path, O_RDONLY);
    205205        if (fd < 0) {
    206206                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to open `%s' for reading: %s.",
     
    210210        opened = true;
    211211       
    212         if (vfs_stat(fd, &st) != EOK) {
    213                 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to fstat %d: %s.", fd,
    214                     str_error(errno));
    215                 goto cleanup;
    216         }
    217         len = st.size;
     212        len = lseek(fd, 0, SEEK_END);
     213        lseek(fd, 0, SEEK_SET);
    218214        if (len == 0) {
    219215                log_msg(LOG_DEFAULT, LVL_ERROR, "Configuration file '%s' is empty.",
     
    229225        }
    230226       
    231         ssize_t read_bytes = vfs_read(fd, (aoff64_t []) {0}, buf, len);
     227        ssize_t read_bytes = read(fd, buf, len);
    232228        if (read_bytes <= 0) {
    233229                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s' (%d).", conf_path,
     
    243239       
    244240        if (opened)
    245                 vfs_put(fd);
     241                close(fd);
    246242       
    247243        return suc;
Note: See TracChangeset for help on using the changeset viewer.