From 64266c2d48111f8f070edb5fcc3a38395dbbd22c Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 25 Jun 2026 03:23:52 +0800 Subject: [PATCH] apps: Replace O_RDOK with O_RDONLY after alias removal The O_RDOK/O_WROK aliases have been removed from fcntl.h. Replace all remaining O_RDOK usage with O_RDONLY in the apps repository. Signed-off-by: Xiang Xiao --- examples/configdata/configdata_main.c | 2 +- nshlib/nsh_script.c | 2 +- platform/mikroe-stm32f4/mikroe_configdata.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/configdata/configdata_main.c b/examples/configdata/configdata_main.c index 3218569f69b..007a9d1620a 100644 --- a/examples/configdata/configdata_main.c +++ b/examples/configdata/configdata_main.c @@ -664,7 +664,7 @@ int main(int argc, FAR char *argv[]) /* Open the /dev/config device */ - g_fd = open("/dev/config", O_RDOK); + g_fd = open("/dev/config", O_RDONLY); if (g_fd == -1) { printf("ERROR: Failed to open /dev/config %d\n", -errno); diff --git a/nshlib/nsh_script.c b/nshlib/nsh_script.c index d1f1d369eff..20114efc05e 100644 --- a/nshlib/nsh_script.c +++ b/nshlib/nsh_script.c @@ -121,7 +121,7 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const FAR char *cmd, /* Open the file containing the script */ - vtbl->np.np_fd = open(fullpath, O_RDOK | O_CLOEXEC); + vtbl->np.np_fd = open(fullpath, O_RDONLY | O_CLOEXEC); if (vtbl->np.np_fd < 0) { if (log) diff --git a/platform/mikroe-stm32f4/mikroe_configdata.c b/platform/mikroe-stm32f4/mikroe_configdata.c index d65e695c771..ab786c62532 100644 --- a/platform/mikroe-stm32f4/mikroe_configdata.c +++ b/platform/mikroe-stm32f4/mikroe_configdata.c @@ -86,7 +86,7 @@ int platform_setconfig(enum config_data_e id, int instance, /* Try to open the /dev/config device file */ - if ((fd = open("/dev/config", O_RDOK)) == -1) + if ((fd = open("/dev/config", O_RDONLY)) == -1) { /* Error opening the config device */ @@ -209,7 +209,7 @@ int platform_getconfig(enum config_data_e id, int instance, /* Try to open the /dev/config device file */ - if ((fd = open("/dev/config", O_RDOK)) == -1) + if ((fd = open("/dev/config", O_RDONLY)) == -1) { /* Error opening the config device */