Changeset b19e892 in mainline for uspace/app/sysinst/futil.c


Ignore:
Timestamp:
2017-04-02T10:39:13Z (8 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().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sysinst/futil.c

    r80743a1 rb19e892  
    3535#include <dirent.h>
    3636#include <errno.h>
    37 #include <fcntl.h>
    3837#include <stdbool.h>
    3938#include <stdio.h>
     
    6463        printf("Copy '%s' to '%s'.\n", srcp, destp);
    6564
    66         sf = open(srcp, O_RDONLY);
     65        sf = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ);
    6766        if (sf < 0)
    6867                return EIO;
    6968
    70         df = open(destp, O_CREAT | O_WRONLY, 0);
     69        df = vfs_lookup_open(destp, WALK_REGULAR | WALK_MAY_CREATE, MODE_WRITE);
    7170        if (df < 0)
    7271                return EIO;
     
    162161        struct stat st;
    163162
    164         sf = open(srcp, O_RDONLY);
     163        sf = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ);
    165164        if (sf < 0)
    166165                return ENOENT;
Note: See TracChangeset for help on using the changeset viewer.