Changeset b19e892 in mainline for uspace/app/tester


Ignore:
Timestamp:
2017-04-02T10:39:13Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9c4cf0d
Parents:
80743a1
Message:

Merge open() with posix_open() and provide vfs_lookup_open() instead

vfs_lookup_open() is really just a convenience wrapper around
vfs_lookup() and vfs_open().

Location:
uspace/app/tester
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/hw/misc/virtchar1.c

    r80743a1 rb19e892  
    4545#include <vfs/vfs.h>
    4646#include <vfs/vfs_sess.h>
    47 #include <fcntl.h>
    4847#include "../../tester.h"
    4948
     
    5554{
    5655        TPRINTF("Opening `%s'...\n", path);
    57         int fd = open(path, O_RDONLY);
     56        int fd = vfs_lookup(path, WALK_REGULAR);
    5857        if (fd < 0) {
    5958                TPRINTF("   ...error: %s\n", str_error(errno));
  • uspace/app/tester/mm/pager1.c

    r80743a1 rb19e892  
    2929#include <stdio.h>
    3030#include <vfs/vfs.h>
    31 #include <fcntl.h>
    3231#include <stdlib.h>
    3332#include <malloc.h>
     
    4847        TPRINTF("Creating temporary file...\n");
    4948
    50         fd = open(TEST_FILE, O_RDWR | O_CREAT);
     49        fd = vfs_lookup_open(TEST_FILE, WALK_REGULAR | WALK_MAY_CREATE,
     50            MODE_READ | MODE_WRITE);
    5151        if (fd < 0)
    5252                return NULL;
  • uspace/app/tester/vfs/vfs1.c

    r80743a1 rb19e892  
    3333#include <vfs/vfs.h>
    3434#include <unistd.h>
    35 #include <fcntl.h>
    3635#include <dirent.h>
    3736#include <loc.h>
     
    7978        TPRINTF("Created directory %s\n", TEST_DIRECTORY);
    8079       
    81         int fd0 = open(TEST_FILE, O_RDWR | O_CREAT);
     80        int fd0 = vfs_lookup_open(TEST_FILE, WALK_REGULAR | WALK_MAY_CREATE,
     81            MODE_READ | MODE_WRITE);
    8282        if (fd0 < 0)
    83                 return "open() failed";
     83                return "vfs_lookup_open() failed";
    8484        TPRINTF("Created file %s (fd=%d)\n", TEST_FILE, fd0);
    8585       
Note: See TracChangeset for help on using the changeset viewer.