Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/isa/isa.c

    r7e9e652 rce04ea44  
    5151#include <malloc.h>
    5252#include <dirent.h>
    53 #include <fcntl.h>
    5453#include <ipc/irc.h>
    5554#include <ipc/services.h>
    56 #include <sys/stat.h>
     55#include <vfs/vfs.h>
    5756#include <irc.h>
    5857#include <ns.h>
     
    254253        size_t len;
    255254        ssize_t r;
    256 
    257         fd = open(conf_path, O_RDONLY);
     255        struct stat st;
     256
     257        fd = vfs_lookup_open(conf_path, WALK_REGULAR, MODE_READ);
    258258        if (fd < 0) {
    259259                ddf_msg(LVL_ERROR, "Unable to open %s", conf_path);
     
    263263        opened = true;
    264264
    265         len = lseek(fd, 0, SEEK_END);
    266         lseek(fd, 0, SEEK_SET);
     265        if (vfs_stat(fd, &st) != EOK) {
     266                ddf_msg(LVL_ERROR, "Unable to vfs_stat %d", fd);
     267                goto cleanup;
     268        }
     269
     270        len = st.size;
    267271        if (len == 0) {
    268272                ddf_msg(LVL_ERROR, "Configuration file '%s' is empty.",
     
    277281        }
    278282
    279         r = read(fd, buf, len);
     283        r = vfs_read(fd, (aoff64_t []) {0}, buf, len);
    280284        if (r < 0) {
    281285                ddf_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path);
     
    294298
    295299        if (opened)
    296                 close(fd);
     300                vfs_put(fd);
    297301
    298302        return buf;
Note: See TracChangeset for help on using the changeset viewer.