zos: fix return value on expired nanosleep() call
In the emulated nanosleep() function on z/OS an EAGAIN error from BPX1CTW/BPX4CTW indicates that the timeout has expired. In that case return 0 and not -1. PR-URL: https://github.com/libuv/libuv/pull/2737 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
a9c58e72a3
commit
875a4fe653
@ -408,10 +408,12 @@ int nanosleep(const struct timespec* req, struct timespec* rem) {
|
||||
* Don't leak EAGAIN, that just means the timeout expired.
|
||||
*/
|
||||
if (rv == -1)
|
||||
if (err != EAGAIN)
|
||||
if (err == EAGAIN)
|
||||
rv = 0;
|
||||
else
|
||||
errno = err;
|
||||
|
||||
if (rem != NULL && (rv == 0 || err == EINTR || err == EAGAIN)) {
|
||||
if (rem != NULL && (rv == 0 || err == EINTR)) {
|
||||
rem->tv_nsec = nanorem;
|
||||
rem->tv_sec = secrem;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user