summaryrefslogtreecommitdiff
path: root/components/libc/termios
diff options
context:
space:
mode:
authorJasonJiaJie <[email protected]>2017-12-07 11:06:10 +0800
committerBernard Xiong <[email protected]>2017-12-07 18:32:06 +0800
commitde0a201e4490d2692e91768a2acb619680d3b89d (patch)
tree1894c141d02167b4389cc06a29aa8aeb39fd8d07 /components/libc/termios
parent049ed5047f49c8662933c51c12e9281daf24f836 (diff)
[Termios]1. Add termios test. 2.Add termios.h
1. Add termios test. 2.Add termios.h
Diffstat (limited to 'components/libc/termios')
-rw-r--r--components/libc/termios/posix_termios.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/components/libc/termios/posix_termios.c b/components/libc/termios/posix_termios.c
index 4ec513ef1d..4f7417cb27 100644
--- a/components/libc/termios/posix_termios.c
+++ b/components/libc/termios/posix_termios.c
@@ -28,8 +28,6 @@
#include <termios.h>
-#include "posix_termios.h"
-
int tcgetattr(int fd, struct termios *tio)
{
/* Get the current serial port settings. */
@@ -41,20 +39,20 @@ int tcgetattr(int fd, struct termios *tio)
int tcsetattr(int fd, int act, const struct termios *tio)
{
- switch (act)
+ switch (act)
{
case TCSANOW:
/* make the change immediately */
return (ioctl(fd, TCSETA, (void*)tio));
case TCSADRAIN:
/*
- * Don't make the change until all currently written data
+ * Don't make the change until all currently written data
* has been transmitted.
*/
return (ioctl(fd, TCSETAW, (void*)tio));
case TCSAFLUSH:
- /* Don't make the change until all currently written data
- * has been transmitted, at which point any received but
+ /* Don't make the change until all currently written data
+ * has been transmitted, at which point any received but
* unread data is also discarded.
*/
return (ioctl(fd, TCSETAF, (void*)tio));
@@ -65,7 +63,7 @@ int tcsetattr(int fd, int act, const struct termios *tio)
}
/**
- * this function gets process group ID for session leader for controlling
+ * this function gets process group ID for session leader for controlling
* terminal
*
* @return always 0
@@ -87,7 +85,7 @@ speed_t cfgetispeed(const struct termios *tio)
int cfsetospeed(struct termios *tio, speed_t speed)
{
- if (speed & ~CBAUD)
+ if (speed & ~CBAUD)
{
errno = EINVAL;
return -1;