nuttx-apps/examples/usrsocktest
Xiang Xiao 5ead824fff apps: Fix O_ACCMODE bitmask checks after Linux flag alignment
After aligning NuttX open() flag constants with Linux (O_RDONLY=0,
O_WRONLY=1, O_RDWR=2), code that used '(flags & O_RDONLY)' or
'(flags & O_WRONLY)' as a bitmask check is broken because O_RDONLY
is now 0.  Fix by using '(flags & O_ACCMODE)' comparisons instead.

  - usrsocktest: replace 'flags & O_RDWR' with 'flags & O_ACCMODE'
    in fcntl F_GETFL assertions
  - dd: verify mode used '(oflags & O_RDONLY)' to detect verify;
    replace with '(oflags & O_ACCMODE) == O_RDWR'
  - dpopen: replace '(oflag & O_RDWR) == O_RDWR' with
    '(oflag & O_ACCMODE) == O_RDWR'
  - usbmsc: replace 'flags & O_WRONLY' with
    '(flags & O_ACCMODE) == O_RDONLY'
  - fcntl_test: replace '(flags & O_WRONLY) == 0' with
    '(flags & O_ACCMODE) == O_RDONLY'

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-30 12:19:58 -04:00
..
CMakeLists.txt examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
defines.h examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Kconfig Application.mk and main.c files: Change builtin's entry point from main to xxx_main by macro expansion. This change make the entry point fully compliant with POSIX/ANSI standard. 2019-10-06 06:14:56 -06: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
usrsocktest_basic_connect.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_basic_daemon.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_basic_getsockname.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_basic_getsockopt.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_basic_send.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_basic_setsockopt.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_block_recv.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_block_send.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_chardev.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_daemon.c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
usrsocktest_main.c include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
usrsocktest_multi_thread.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_noblock_connect.c apps: Fix O_ACCMODE bitmask checks after Linux flag alignment 2026-06-30 12:19:58 -04:00
usrsocktest_noblock_recv.c apps: Fix O_ACCMODE bitmask checks after Linux flag alignment 2026-06-30 12:19:58 -04:00
usrsocktest_noblock_send.c apps: Fix O_ACCMODE bitmask checks after Linux flag alignment 2026-06-30 12:19:58 -04:00
usrsocktest_nodaemon.c examples: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
usrsocktest_poll.c apps: Fix O_ACCMODE bitmask checks after Linux flag alignment 2026-06-30 12:19:58 -04:00
usrsocktest_remote_disconnect.c apps: Fix O_ACCMODE bitmask checks after Linux flag alignment 2026-06-30 12:19:58 -04:00
usrsocktest_wake_with_signal.c signals: fix build and runtime issues when signals all isabled 2026-01-19 22:55:19 +08:00