# Threaded.sleepPosix: fix libc error handling · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/ecb9ddf2672fa1f067c240d914a5baf3a4d2d8a4)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: ecb9ddf2672fa1f067c240d914a5baf3a4d2d8a4

Requested commit: ecb9ddf2672fa1f067c240d914a5baf3a4d2d8a4

Commit: ecb9ddf2672fa1f067c240d914a5baf3a4d2d8a4

Tree: b819f184ff9070176c232acd5afce33d473b0678

Author: Brandon Black

Committer: Andrew Kelley

## Message

```
Threaded.sleepPosix: fix libc error handling

Confusingly, the POSIX spec for clock_nanosleep() says it returns
*positive* error values directly and does not touch `errno`. Not
detecting EINTR properly here was breaking the cancellation of
threads blocked in this call when linking libc.

```

## Parents

- [9b415761dd66904aef363e387b4501f3ddd0bf76](https://git.cafe/gitcafe/zig/commit/9b415761dd66904aef363e387b4501f3ddd0bf76?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/ecb9ddf2672fa1f067c240d914a5baf3a4d2d8a4?format=markdown)
