!574 fix: solve SIGCHLD ignored in sigsuspend()
Merge pull request !574 from MGY917/sigsuspend
This commit is contained in:
commit
e095e87682
|
@ -575,9 +575,21 @@ int OsSigSuspend(const sigset_t *set)
|
||||||
|
|
||||||
/* If pending mask not in sigmask, need set sigflag */
|
/* If pending mask not in sigmask, need set sigflag */
|
||||||
OsSigMaskSwitch(rtcb, *set);
|
OsSigMaskSwitch(rtcb, *set);
|
||||||
ret = OsSigTimedWaitNoLock(&setSuspend, NULL, LOS_WAIT_FOREVER);
|
|
||||||
if (ret < 0) {
|
if (rtcb->sig.sigFlag > 0) {
|
||||||
PRINT_ERR("FUNC %s LINE = %d, ret = %x\n", __FUNCTION__, __LINE__, ret);
|
SCHEDULER_UNLOCK(intSave);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If rtcb->sig.sigFlag > 0, it means that some signal have been
|
||||||
|
* received, and we need to do schedule to handle the signal directly.
|
||||||
|
*/
|
||||||
|
LOS_Schedule();
|
||||||
|
return -EINTR;
|
||||||
|
} else {
|
||||||
|
ret = OsSigTimedWaitNoLock(&setSuspend, NULL, LOS_WAIT_FOREVER);
|
||||||
|
if (ret < 0) {
|
||||||
|
PRINT_ERR("FUNC %s LINE = %d, ret = %x\n", __FUNCTION__, __LINE__, ret);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SCHEDULER_UNLOCK(intSave);
|
SCHEDULER_UNLOCK(intSave);
|
||||||
|
|
Loading…
Reference in New Issue