Changeset b19e892 in mainline for uspace/srv/vfs/vfs_ops.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/srv/vfs/vfs_ops.c

    r80743a1 rb19e892  
    4949#include <unistd.h>
    5050#include <ctype.h>
    51 #include <fcntl.h>
    5251#include <assert.h>
    5352#include <vfs/canonify.h>
     
    274273}
    275274
    276 int vfs_op_open(int fd, int flags)
    277 {
    278         if (flags == 0)
     275int vfs_op_open(int fd, int mode)
     276{
     277        if (mode == 0)
    279278                return EINVAL;
    280279
     
    283282                return EBADF;
    284283       
    285         if ((flags & ~file->permissions) != 0) {
     284        if ((mode & ~file->permissions) != 0) {
    286285                vfs_file_put(file);
    287286                return EPERM;
     
    293292        }
    294293       
    295         file->open_read = (flags & MODE_READ) != 0;
    296         file->open_write = (flags & (MODE_WRITE | MODE_APPEND)) != 0;
    297         file->append = (flags & MODE_APPEND) != 0;
     294        file->open_read = (mode & MODE_READ) != 0;
     295        file->open_write = (mode & (MODE_WRITE | MODE_APPEND)) != 0;
     296        file->append = (mode & MODE_APPEND) != 0;
    298297       
    299298        if (!file->open_read && !file->open_write) {
Note: See TracChangeset for help on using the changeset viewer.