You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/03/18 17:09:22 UTC

[incubator-nuttx-apps] branch pr126 updated: examples/slcd: fix priv->fd that was used by slcd_flush before being set

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

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


The following commit(s) were added to refs/heads/pr126 by this push:
     new 94a7f29  examples/slcd: fix priv->fd that was used by slcd_flush before being set
94a7f29 is described below

commit 94a7f29906d154a6c89b3792b67e051f0593b5c1
Author: Pierre-Olivier Vauboin <po...@lambdaconcept.com>
AuthorDate: Wed Mar 18 14:56:27 2020 +0100

    examples/slcd: fix priv->fd that was used by slcd_flush before being set
---
 examples/slcd/slcd_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/slcd/slcd_main.c b/examples/slcd/slcd_main.c
index 3103c4a..ff1153a 100644
--- a/examples/slcd/slcd_main.c
+++ b/examples/slcd/slcd_main.c
@@ -267,7 +267,7 @@ int main(int argc, FAR char *argv[])
   printf("Opening %s for read/write access\n", CONFIG_EXAMPLES_SLCD_DEVNAME);
 
   fd = open(CONFIG_EXAMPLES_SLCD_DEVNAME, O_RDWR);
-  if (priv->fd < 0)
+  if (fd < 0)
     {
       printf("Failed to open %s: %d\n", CONFIG_EXAMPLES_SLCD_DEVNAME, errno);
       goto errout;
@@ -286,6 +286,7 @@ int main(int argc, FAR char *argv[])
 #ifdef CONFIG_STDIO_LINEBUFFER
       priv->stream.flush = slcd_flush;
 #endif
+      priv->fd = fd;
 
       /* Get the attributes of the SCLD device */