Skip to content
Snippets Groups Projects
Commit 0c04d909 authored by patacongo's avatar patacongo
Browse files

Exit after reading EOF

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2221 42af7a65-404d-4744-a932-0658087f49c3
parent 200a91f8
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment