diff options
| author | Han Xinrong <[email protected]> | 2020-12-13 19:11:04 +0800 |
|---|---|---|
| committer | Han Xinrong <[email protected]> | 2020-12-13 19:11:04 +0800 |
| commit | a1fe7b1ddf882ab37eb61157fffcf2e42c7b2357 (patch) | |
| tree | 28a0e7f882928f3a72c3f80b5e2913327469b4a2 /components/dfs | |
| parent | 3bb8edf4c1b9b0a8ecb1cd9072da3e5edc3502b0 (diff) | |
modify the error check of rt_event_recv()
Diffstat (limited to 'components/dfs')
| -rw-r--r-- | components/dfs/filesystems/jffs2/src/gcthread.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/components/dfs/filesystems/jffs2/src/gcthread.c b/components/dfs/filesystems/jffs2/src/gcthread.c index 3807e705b1..0aad0ae3ae 100644 --- a/components/dfs/filesystems/jffs2/src/gcthread.c +++ b/components/dfs/filesystems/jffs2/src/gcthread.c @@ -203,7 +203,13 @@ jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c) GC_THREAD_FLAG_HAS_EXIT, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, RT_WAITING_FOREVER, &e); - RT_ASSERT(result == RT_EOK); + if (result == -RT_ETIMEOUT) { + LOG_E("wait completed timeout"); + return; + }else if (result == -RT_ERROR) { + LOG_E("event received error"); + return; + } // Kill and free the resources ... this is safe due to the flag // from the thread. @@ -230,7 +236,13 @@ jffs2_garbage_collect_thread(unsigned long data) RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, cyg_current_time() + CYGNUM_JFFS2_GS_THREAD_TICKS, &flag); - RT_ASSERT(result == RT_EOK); + if (result == -RT_ETIMEOUT) { + LOG_E("wait completed timeout"); + continue; + }else if (result == -RT_ERROR) { + LOG_E("event received error"); + continue; + } if (flag & GC_THREAD_FLAG_STOP) break; |
