This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 214dbe5  open() options: pass file options 0 if only ioctl is used
214dbe5 is described below

commit 214dbe51b4ced7875a5981046ea8c7298b7c57fc
Author: Petro Karashchenko <[email protected]>
AuthorDate: Fri Apr 1 09:53:43 2022 +0200

    open() options: pass file options 0 if only ioctl is used
    
    Signed-off-by: Petro Karashchenko <[email protected]>
---
 examples/pca9635/pca9635_main.c | 2 +-
 system/cfgdata/cfgdata_main.c   | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/pca9635/pca9635_main.c b/examples/pca9635/pca9635_main.c
index 7fd00dd..bf17c91 100644
--- a/examples/pca9635/pca9635_main.c
+++ b/examples/pca9635/pca9635_main.c
@@ -59,7 +59,7 @@ int main(int argc, FAR char *argv[])
   int fd;
   int ret;
 
-  fd = open(CONFIG_EXAMPLES_PCA9635_DEVNAME, O_WRONLY);
+  fd = open(CONFIG_EXAMPLES_PCA9635_DEVNAME, 0);
   if (fd < 0)
     {
       fprintf(stderr, "ERROR: Failed to open %s: %d\n",
diff --git a/system/cfgdata/cfgdata_main.c b/system/cfgdata/cfgdata_main.c
index af601b1..c589b57 100644
--- a/system/cfgdata/cfgdata_main.c
+++ b/system/cfgdata/cfgdata_main.c
@@ -335,7 +335,7 @@ static void cfgdatacmd_set(int argc, char *argv[])
 
   /* Now open the /dev/config file and set the config item */
 
-  if ((fd = open(g_config_dev, O_WRONLY)) < 2)
+  if ((fd = open(g_config_dev, 0)) < 2)
     {
       /* Display error */
 
@@ -402,7 +402,7 @@ static void cfgdatacmd_unset(int argc, char *argv[])
 
   /* Try to open the /dev/config file */
 
-  if ((fd = open(g_config_dev, O_WRONLY)) < 2)
+  if ((fd = open(g_config_dev, 0)) < 2)
     {
       /* Display error */
 
@@ -549,7 +549,7 @@ static void cfgdatacmd_show_all_config_items(void)
 
   /* Try to open the /dev/config file */
 
-  if ((fd = open(g_config_dev, O_RDONLY)) < 2)
+  if ((fd = open(g_config_dev, 0)) < 2)
     {
       /* Display error */
 
@@ -658,7 +658,7 @@ static void cfgdatacmd_format(void)
 
   /* Try to open the /dev/config file */
 
-  if ((fd = open(g_config_dev, O_WRONLY)) < 2)
+  if ((fd = open(g_config_dev, 0)) < 2)
     {
       /* Display error */
 

Reply via email to