Changeset 0d0b319 in mainline for uspace/lib/posix/source/sys


Ignore:
Timestamp:
2018-01-04T20:03:02Z (8 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.

Location:
uspace/lib/posix/source/sys
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/source/sys/mman.c

    r10de842 r0d0b319  
    5959int posix_munmap(void *start, size_t length)
    6060{
    61         return as_area_destroy(start);
     61        int rc = as_area_destroy(start);
     62        if (rc != EOK) {
     63                errno = rc;
     64                return -1;
     65        }
     66        return 0;
    6267}
    6368
  • uspace/lib/posix/source/sys/stat.c

    r10de842 r0d0b319  
    4141#include "libc/vfs/vfs.h"
    4242
    43 #include "posix/errno.h"
     43#include <errno.h>
    4444#include "libc/mem.h"
    4545
     
    8989{
    9090        struct stat hst;
    91         int rc = rcerrno(vfs_stat, fd, &hst);
    92         if (rc < 0)
     91        if (failed(vfs_stat(fd, &hst)))
    9392                return -1;
    9493        return stat_to_posix(st, &hst);
     
    118117{
    119118        struct stat hst;
    120         int rc = rcerrno(vfs_stat_path, path, &hst);
    121         if (rc < 0)
     119        if (failed(vfs_stat_path(path, &hst)))
    122120                return -1;
    123121        return stat_to_posix(st, &hst);
     
    159157int posix_mkdir(const char *path, posix_mode_t mode)
    160158{
    161         int rc = rcerrno(vfs_link_path, path, KIND_DIRECTORY, NULL);
    162         if (rc != EOK)
     159        if (failed(vfs_link_path(path, KIND_DIRECTORY, NULL)))
    163160                return -1;
    164161        else
  • uspace/lib/posix/source/sys/wait.c

    r10de842 r0d0b319  
    4242#include "libc/task.h"
    4343#include "posix/assert.h"
    44 #include "posix/errno.h"
     44
     45#include <errno.h>
     46
    4547#include "posix/limits.h"
    4648#include "posix/signal.h"
     
    100102        int retval;
    101103       
    102         int rc = task_wait_task_id((task_id_t) pid, &texit, &retval);
    103        
    104         if (rc < 0) {
     104        if (failed(task_wait_task_id((task_id_t) pid, &texit, &retval))) {
    105105                /* Unable to retrieve status. */
    106                 errno = -rc;
    107106                return (posix_pid_t) -1;
    108107        }
Note: See TracChangeset for help on using the changeset viewer.