work around -Wclobbered-noted problem

This commit is contained in:
nick black 2019-12-18 21:05:59 -05:00 committed by Nick Black
parent e871660eff
commit e2c58534ca

View File

@ -38,13 +38,15 @@ blocking_write(int fd, const char* buf, size_t buflen){
}
int notcurses_refresh(notcurses* nc){
int ret = 0;
int ret;
pthread_mutex_lock(&nc->lock);
pthread_cleanup_push(mutex_unlock, &nc->lock);
if(nc->mstream == NULL){
ret = -1; // haven't rendered yet, and thus don't know what should be there
}else if(blocking_write(nc->ttyfd, nc->mstream, nc->mstrsize)){
ret = -1;
}else{
ret = 0;
}
pthread_cleanup_pop(1);
return ret;