diff options
author | Matt Joyce <matthew.joyce@embedded-brains.de> | 2022-02-02 09:49:00 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-07-13 06:55:46 +0200 |
commit | 0985d418cb2d0a5ba56518e9e1fb9a31f3c7ba48 (patch) | |
tree | 69501520d885fc1a766e6ccb0ce83d6d5a979886 /newlib/libc/stdio/tmpnam.c | |
parent | e56801f34d798eafa054b383de5bf2df986576cc (diff) | |
download | newlib-0985d418cb2d0a5ba56518e9e1fb9a31f3c7ba48.zip newlib-0985d418cb2d0a5ba56518e9e1fb9a31f3c7ba48.tar.gz newlib-0985d418cb2d0a5ba56518e9e1fb9a31f3c7ba48.tar.bz2 |
Add _REENT_INC(ptr)
Add a _REENT_INC() macro to encapsulate access to the _inc member
of struct reent. This will help to replace the struct member with
a thread-local storage object in a follow up patch.
Diffstat (limited to 'newlib/libc/stdio/tmpnam.c')
-rw-r--r-- | newlib/libc/stdio/tmpnam.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/newlib/libc/stdio/tmpnam.c b/newlib/libc/stdio/tmpnam.c index 7379a76..2767b4b 100644 --- a/newlib/libc/stdio/tmpnam.c +++ b/newlib/libc/stdio/tmpnam.c @@ -135,9 +135,9 @@ _tmpnam_r (struct _reent *p, } pid = _getpid_r (p); - if (worker (p, result, P_tmpdir, "t", pid, &p->_inc)) + if (worker (p, result, P_tmpdir, "t", pid, &_REENT_INC(p))) { - p->_inc++; + _REENT_INC(p)++; return result; } @@ -162,7 +162,7 @@ _tempnam_r (struct _reent *p, if (filename) { if (! worker (p, filename, dir, prefix, - _getpid_r (p) ^ (int) (_POINTER_INT) p, &p->_inc)) + _getpid_r (p) ^ (int) (_POINTER_INT) p, &_REENT_INC(p))) return NULL; } return filename; |