mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
pthread_cond_timedwait() directly returns errno #2169
This commit is contained in:
parent
b5a72b50ed
commit
aa6b9486c9
@ -1826,10 +1826,10 @@ internal_get(inputctx* ictx, const struct timespec* ts, ncinput* ni){
|
||||
if(ts == NULL){
|
||||
pthread_cond_wait(&ictx->icond, &ictx->ilock);
|
||||
}else{
|
||||
if(pthread_cond_timedwait(&ictx->icond, &ictx->ilock, ts)){
|
||||
if(errno == ETIMEDOUT){
|
||||
return 0;
|
||||
}
|
||||
int r = pthread_cond_timedwait(&ictx->icond, &ictx->ilock, ts);
|
||||
if(r == ETIMEDOUT){
|
||||
return 0;
|
||||
}else if(r < 0){
|
||||
inc_input_errors(ictx);
|
||||
return (uint32_t)-1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user