diff options
author | Matt Joyce <matthew.joyce@embedded-brains.de> | 2022-01-18 12:13:04 +0300 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-07-13 07:55:41 +0300 |
commit | f3b8138239d3ba34c4ecaa4305b0fbd7eb4e28a5 (patch) | |
tree | 80cc7a629134d4568bf5dc71898266555a6863b0 /newlib/libc/signal | |
parent | d0d78e96ebf4187fb9362465f1a397680447046f (diff) |
Add _REENT_ERRNO(ptr)
Add a _REENT_ERRNO() macro to encapsulate the access to the
_errno member of struct reent. This will help to replace the
structure member with a thread-local storage object in a follow
up patch.
Replace uses of __errno_r() with _REENT_ERRNO(). Keep __errno_r() macro for
potential users outside of Newlib.
Diffstat (limited to 'newlib/libc/signal')
-rw-r--r-- | newlib/libc/signal/signal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/newlib/libc/signal/signal.c b/newlib/libc/signal/signal.c index 0110287d8..a249e9f00 100644 --- a/newlib/libc/signal/signal.c +++ b/newlib/libc/signal/signal.c @@ -115,7 +115,7 @@ _signal_r (struct _reent *ptr, if (sig < 0 || sig >= NSIG) { - ptr->_errno = EINVAL; + _REENT_ERRNO(ptr) = EINVAL; return SIG_ERR; } @@ -136,7 +136,7 @@ _raise_r (struct _reent *ptr, if (sig < 0 || sig >= NSIG) { - ptr->_errno = EINVAL; + _REENT_ERRNO(ptr) = EINVAL; return -1; } @@ -151,7 +151,7 @@ _raise_r (struct _reent *ptr, return 0; else if (func == SIG_ERR) { - ptr->_errno = EINVAL; + _REENT_ERRNO(ptr) = EINVAL; return 1; } else |