修改线程获取缓冲区失败问题。

修改共享内存地址映射失败时的判错条件,shmat失败会返回(void *)-1而不是NULL
This commit is contained in:
guo_peixu
2022-06-23 14:20:32 +08:00
parent 4531d74c80
commit fada178df2
2 changed files with 25 additions and 26 deletions

View File

@@ -529,7 +529,8 @@ int main(int argc, char **argv)
}
if(ring_queue_head[i] == NULL){
ring_queue_head[i] = shmat(tmp_ovw->shmid, NULL, 0);
if(ring_queue_head[i] == NULL){
if(ring_queue_head[i] == (struct MESA_shm_queue_head *)-1){
ring_queue_head[i] = NULL;
break ;
}
}