mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
examples/slcd: fix priv->fd that was used by slcd_flush before being set
This commit is contained in:
parent
e1d9e82273
commit
f17d89d085
1 changed files with 2 additions and 1 deletions
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue