diff options
| author | Han Xinrong <[email protected]> | 2020-12-07 20:13:03 +0800 |
|---|---|---|
| committer | Han Xinrong <[email protected]> | 2020-12-09 22:24:01 +0800 |
| commit | 3bb8edf4c1b9b0a8ecb1cd9072da3e5edc3502b0 (patch) | |
| tree | a5496a0655ce5e752b37ba5e10badd7109caea92 /components | |
| parent | 3f122bd790231ad097cc2346fa574a660eb294da (diff) | |
error check of rt_event_recv()
add error check
Diffstat (limited to 'components')
| -rw-r--r-- | components/dfs/filesystems/jffs2/src/gcthread.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/components/dfs/filesystems/jffs2/src/gcthread.c b/components/dfs/filesystems/jffs2/src/gcthread.c index 4005ec4788..3807e705b1 100644 --- a/components/dfs/filesystems/jffs2/src/gcthread.c +++ b/components/dfs/filesystems/jffs2/src/gcthread.c @@ -187,7 +187,8 @@ jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c) { struct super_block *sb=OFNI_BS_2SFFJ(c); cyg_mtab_entry *mte; - rt_uint32_t e; + rt_uint32_t e; + rt_err_t result; //RT_ASSERT(sb->s_gc_thread_handle); @@ -198,10 +199,11 @@ jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c) D1(printk("jffs2_stop_garbage_collect_thread wait\n")); - rt_event_recv(&sb->s_gc_thread_flags, + result = rt_event_recv(&sb->s_gc_thread_flags, GC_THREAD_FLAG_HAS_EXIT, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, RT_WAITING_FOREVER, &e); + RT_ASSERT(result == RT_EOK); // Kill and free the resources ... this is safe due to the flag // from the thread. @@ -218,15 +220,17 @@ jffs2_garbage_collect_thread(unsigned long data) struct super_block *sb=OFNI_BS_2SFFJ(c); cyg_mtab_entry *mte; rt_uint32_t flag = 0; + rt_err_t result; D1(printk("jffs2_garbage_collect_thread START\n")); while(1) { - rt_event_recv(&sb->s_gc_thread_flags, + result = rt_event_recv(&sb->s_gc_thread_flags, GC_THREAD_FLAG_TRIG | GC_THREAD_FLAG_STOP, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, cyg_current_time() + CYGNUM_JFFS2_GS_THREAD_TICKS, &flag); + RT_ASSERT(result == RT_EOK); if (flag & GC_THREAD_FLAG_STOP) break; |
