Commit c90a48fa authored by Werner Koch's avatar Werner Koch

Don't get fooled by leave_npth changing ERRNO.

* src/npth.c: Save ERRNO.
--
GnuPG-bug-id: 1773

Note that there is no need to do that in enter_pth because the specs
for sem_post don't identify EINTR as a possible return value.
parent 4d253e6a
Noteworthy changes in version 1.2 (unreleased)
----------------------------------------------
* Fix possible clobbering of ERRNO.
Noteworthy changes in version 1.1 (2014-10-31)
----------------------------------------------
......
......@@ -128,12 +128,14 @@ static void
leave_npth (void)
{
int res;
int save_errno = errno;
do {
res = sem_wait (sceptre);
} while (res < 0 && errno == EINTR);
assert (!res);
errno = save_errno;
}
#define ENTER() enter_npth ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment