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/internal/common.h

    r8bfb163 r132ab5d1  
    5050        } while (0)
    5151
    52 /* Convert negative errno to positive errno */
    53 #define negerrno(func, ...) ({ \
    54         int rc = func(__VA_ARGS__); \
    55         if (rc < 0) { \
    56                 errno = -errno; \
    57         } \
    58         rc; \
    59 })
    60 
    61 /* Convert error code to positive errno and -1 return value */
    62 #define rcerrno(func, ...) ({ \
    63         int rc = func(__VA_ARGS__); \
    64         if (rc < 0) \
    65                 errno = -rc; \
    66         rc; \
    67 })
     52/* Checks if the value is a failing error code.
     53 * If so, writes the error code to errno and returns true.
     54 */
     55static inline bool failed(int rc) {
     56        if (rc != EOK) {
     57                errno = rc;
     58                return true;
     59        }
     60        return false;
     61}
    6862
    6963extern aoff64_t posix_pos[MAX_OPEN_FILES];
Note: See TracChangeset for help on using the changeset viewer.