diff options
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/examples/usbserial/host.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/nuttx/examples/usbserial/host.c b/nuttx/examples/usbserial/host.c index 235d1f402..f0235ec20 100644 --- a/nuttx/examples/usbserial/host.c +++ b/nuttx/examples/usbserial/host.c @@ -237,6 +237,11 @@ int main(int argc, char **argv, char **envp) close(fd); return 2; } + else if (nbytes == 0) + { + printf("main: End-of-file encountereDs\n"); + break; + } g_iobuffer[nbytes] = '\0'; printf("main: Received %d bytes:\n", nbytes); @@ -282,8 +287,6 @@ int main(int argc, char **argv, char **envp) #endif /* CONFIG_EXAMPLES_USBSERIAL_INONLY */ } - /* Won't get here, but if we did this what we would have to do */ - close(fd); return 0; } |