nuttx-apps/system/dd
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 system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
dd_main.c apps: Fix O_ACCMODE bitmask checks after Linux flag alignment 2026-06-30 12:19:58 -04:00
Kconfig nshlib/dd: remove nsh dd cmd 2025-04-20 00:41:18 +08:00
Make.defs system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Makefile system: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00