nuttx-apps/examples/pipe
wangzhi16 f16a45a854 examples/pipe: bugfix testcase of fifo
There are three bug in fifo testcase.

1. line 211 and line 295 should be nbytes not ret.
2. coverity report error:
CID 1667262: (#4 of 11): Double close (USE_AFTER_FREE)
11. double_close: Calling close(int) will close the handle fd that has already been closed. [Note: The source code implementation of this function has been overwritten by the built-in model.]

Double close will ocurr when line 234 is true and goto line 341, close again!
Now, Using the previous code logic, Use a tid and an errout_with_null_thread to avoid uninitialized problems.

3. since line 295 is used ret not nbytes, error not expose before.

When the end of read and write are opened, end of write will write successfully even if end of read not read.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-22 19:53:39 +08:00
..
CMakeLists.txt examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
interlock_test.c examples/pipe: bugfix testcase of fifo 2026-01-22 19:53:39 +08:00
Kconfig pipe: modify default stack size to fix stack overflow 2021-07-12 20:27:39 -07:00
Make.defs examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Makefile examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
pipe.h examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
pipe_main.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
redirect_test.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
transfer_test.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00