Changeset 0d0b319 in mainline for uspace/lib/posix/source/stdio.c


Ignore:
Timestamp:
2018-01-04T20:03:02Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3c7702c0
Parents:
10de842
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 19:18:29)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:03:02)
Message:

Flip error constants to positive values, and update libposix for the change.

File:
1 edited

Legend:

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

    r10de842 r0d0b319  
    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
     
    344346        const int fildes = *(int *) fd;
    345347        size_t wr;
    346         int rc = vfs_write(fildes, &posix_pos[fildes], str, size, &wr);
    347         if (rc != EOK)
    348                 return rc;
     348        if (failed(vfs_write(fildes, &posix_pos[fildes], str, size, &wr)))
     349                return -1;
    349350        return str_nlength(str, wr);
    350351}
     
    576577int posix_remove(const char *path)
    577578{
    578         if (rcerrno(vfs_unlink_path, path) != EOK)
     579        if (failed(vfs_unlink_path(path)))
    579580                return -1;
    580581        else
     
    591592int posix_rename(const char *old, const char *new)
    592593{
    593         int rc = rcerrno(vfs_rename_path, old, new);
    594         if (rc != EOK)
     594        if (failed(vfs_rename_path(old, new)))
    595595                return -1;
    596596        else
     
    664664               
    665665                int orig_errno = errno;
    666                 errno = 0;
     666                errno = EOK;
    667667                /* Check if the file exists. */
    668668                if (posix_access(result, F_OK) == -1) {
Note: See TracChangeset for help on using the changeset viewer.