Changeset 132ab5d1 in mainline for uspace/lib/posix/source/fcntl.c


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (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 commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/source/fcntl.c

    r8bfb163 r132ab5d1  
    4040
    4141#include "libc/vfs/vfs.h"
    42 #include "posix/errno.h"
     42
     43#include <errno.h>
    4344
    4445/**
     
    103104int posix_open(const char *pathname, int posix_flags, ...)
    104105{
    105         int rc;
    106106        posix_mode_t posix_mode = 0;
    107107        if (posix_flags & O_CREAT) {
     
    135135            ((posix_flags & O_APPEND) ? MODE_APPEND : 0);
    136136
    137         int file = rcerrno(vfs_lookup, pathname, flags);
    138         if (file < 0)
     137        int file;
     138
     139        if (failed(vfs_lookup(pathname, flags, &file)))
    139140                return -1;
    140141
    141         rc = rcerrno(vfs_open, file, mode);
    142         if (rc != EOK) {
     142        if (failed(vfs_open(file, mode))) {
    143143                vfs_put(file);
    144144                return -1;
     
    147147        if (posix_flags & O_TRUNC) {
    148148                if (posix_flags & (O_RDWR | O_WRONLY)) {
    149                         rc = rcerrno(vfs_resize, file, 0);
    150                         if (rc != EOK) {
     149                        if (failed(vfs_resize(file, 0))) {
    151150                                vfs_put(file);
    152151                                return -1;
Note: See TracChangeset for help on using the changeset viewer.