summaryrefslogtreecommitdiff
path: root/apps/examples
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples')
-rw-r--r--apps/examples/cdcacm/Kconfig1
-rw-r--r--apps/examples/ftpc/ftpc_main.c11
-rw-r--r--apps/examples/usbterm/usbterm_main.c9
3 files changed, 10 insertions, 11 deletions
diff --git a/apps/examples/cdcacm/Kconfig b/apps/examples/cdcacm/Kconfig
index 1e0b3f3ed..78fea4d0d 100644
--- a/apps/examples/cdcacm/Kconfig
+++ b/apps/examples/cdcacm/Kconfig
@@ -6,6 +6,7 @@
config EXAMPLES_CDCACM
bool "CDC/ACM example"
default n
+ depends on CDCACM
---help---
Enable the USB CDC/ACM class driver example
diff --git a/apps/examples/ftpc/ftpc_main.c b/apps/examples/ftpc/ftpc_main.c
index 866a69cdb..deba62c1c 100644
--- a/apps/examples/ftpc/ftpc_main.c
+++ b/apps/examples/ftpc/ftpc_main.c
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/ftpc/ftpc_main.c
*
- * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -431,14 +431,13 @@ int ftpc_main(int argc, char **argv, char **envp)
ret = readline(g_line, CONFIG_FTPC_LINELEN, stdin, stdout);
/* Readline normally returns the number of characters read,
- * but will return 0 on end of file or a negative value
- * if an error occurs. Either will cause the session to
- * terminate.
+ * but will return EOF on end of file or if an error occurs.
+ * Either will cause the session to terminate.
*/
- if (ret <= 0)
+ if (ret == EOF)
{
- printf("ERROR: readline failed: %d\n", ret);
+ printf("ERROR: readline failed: %d\n", errno);
return 1;
}
#endif
diff --git a/apps/examples/usbterm/usbterm_main.c b/apps/examples/usbterm/usbterm_main.c
index 69301dfcd..747a52978 100644
--- a/apps/examples/usbterm/usbterm_main.c
+++ b/apps/examples/usbterm/usbterm_main.c
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/usbterm/usbterm_main.c
*
- * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -325,12 +325,11 @@ int usbterm_main(int argc, char *argv[])
ret = readline(g_usbterm.outbuffer, CONFIG_EXAMPLES_USBTERM_BUFLEN, stdin, stdout);
/* Readline normally returns the number of characters read,
- * but will return 0 on end of file or a negative value
- * if an error occurs. Either will cause the session to
- * terminate.
+ * but will return EOF on end of file or if an error occurs. Either
+ * will cause the session to terminate.
*/
- if (ret <= 0)
+ if (ret == EOF)
{
printf("ERROR: readline failed: %d\n", ret);
return 1;