[net][lwip] fix assert in the sys_arch_mbox_fetch function when close socket

This commit is contained in:
liuxinaliang 2019-12-29 15:32:27 +08:00
parent c2322353aa
commit a0e62f665f
3 changed files with 15 additions and 25 deletions

View File

@ -498,14 +498,10 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout)
} }
ret = rt_mb_recv(*mbox, (rt_ubase_t *)msg, t); ret = rt_mb_recv(*mbox, (rt_ubase_t *)msg, t);
if(ret == -RT_ETIMEOUT) if(ret != RT_EOK)
{ {
return SYS_ARCH_TIMEOUT; return SYS_ARCH_TIMEOUT;
} }
else
{
LWIP_ASSERT("rt_mb_recv returned with error!", ret == RT_EOK);
}
/* get elapse msecond */ /* get elapse msecond */
tick = rt_tick_get() - tick; tick = rt_tick_get() - tick;

View File

@ -509,12 +509,9 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout)
} }
ret = rt_mb_recv(*mbox, (rt_ubase_t *)msg, t); ret = rt_mb_recv(*mbox, (rt_ubase_t *)msg, t);
if(ret != RT_EOK)
if(ret == -RT_ETIMEOUT)
return SYS_ARCH_TIMEOUT;
else
{ {
LWIP_ASSERT("rt_mb_recv returned with error!", ret == RT_EOK); return SYS_ARCH_TIMEOUT;
} }
/* get elapse msecond */ /* get elapse msecond */

View File

@ -523,12 +523,9 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout)
} }
ret = rt_mb_recv(*mbox, (rt_ubase_t *)msg, t); ret = rt_mb_recv(*mbox, (rt_ubase_t *)msg, t);
if(ret != RT_EOK)
if(ret == -RT_ETIMEOUT)
return SYS_ARCH_TIMEOUT;
else
{ {
LWIP_ASSERT("rt_mb_recv returned with error!", ret == RT_EOK); return SYS_ARCH_TIMEOUT;
} }
/* get elapse msecond */ /* get elapse msecond */