Changeset 368ee04 in mainline for uspace/drv/bus/isa/isa.c


Ignore:
Timestamp:
2017-04-05T18:10:39Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
93ad8166
Parents:
39f892a9 (diff), 2166728 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~jakub/helenos/vfs-2.5-cherrypick

This merge cherry-picks some of the changesets from Jiri Zarevucky's:

lp:~zarevucky-jiri/helenos/vfs-2.5

and then continues independently, yet sometime in a similar vein.

Roughly speaking, Jiri's branch is merged entirely up to its revision
1926 and then cherry-picked on and off until its revision 1965. Among
these changes are:

  • relativization of the API,
  • client-side roots,
  • server-side mounts,
  • inbox for passing arbitrary files from parent to child,
  • some streamlining and cleanup.

Additional changes include:

  • addressing issues introduced by the above changes,
  • client-side I/O cursors (file positions),
  • all HelenOS file system APIs begin with the vfs_ prefix and can be used after including vfs/vfs.h,
  • removal of some POSIX-ish headers and definitions,
  • additional cleanup.
File:
1 edited

Legend:

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

    r39f892a9 r368ee04  
    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.