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


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, 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/stdio.c

    r8bfb163 r132ab5d1  
    4141
    4242#include "posix/assert.h"
    43 #include "posix/errno.h"
     43
     44#include <errno.h>
     45
    4446#include "posix/stdlib.h"
    4547#include "posix/string.h"
     
    313315int posix_fflush(FILE *stream)
    314316{
    315         return negerrno(fflush, stream);
     317        return fflush(stream);
    316318}
    317319
     
    343345{
    344346        const int fildes = *(int *) fd;
    345         ssize_t wr = vfs_write(fildes, &posix_pos[fildes], str, size);
    346         if (wr < 0)
    347                 return wr;
     347        size_t wr;
     348        if (failed(vfs_write(fildes, &posix_pos[fildes], str, size, &wr)))
     349                return -1;
    348350        return str_nlength(str, wr);
    349351}
     
    371373               
    372374                const int fildes = *(int *) fd;
    373                 if (vfs_write(fildes, &posix_pos[fildes], buf, sz) < 0)
     375                size_t nwr;
     376                if (vfs_write(fildes, &posix_pos[fildes], buf, sz, &nwr) != EOK)
    374377                        break;
    375378               
     
    574577int posix_remove(const char *path)
    575578{
    576         if (rcerrno(vfs_unlink_path, path) != EOK)
     579        if (failed(vfs_unlink_path(path)))
    577580                return -1;
    578581        else
     
    589592int posix_rename(const char *old, const char *new)
    590593{
    591         int rc = rcerrno(vfs_rename_path, old, new);
    592         if (rc != EOK)
     594        if (failed(vfs_rename_path(old, new)))
    593595                return -1;
    594596        else
     
    662664               
    663665                int orig_errno = errno;
    664                 errno = 0;
     666                errno = EOK;
    665667                /* Check if the file exists. */
    666668                if (posix_access(result, F_OK) == -1) {
Note: See TracChangeset for help on using the changeset viewer.