fixed a bug in sys::tcsetattr()

This commit is contained in:
hyung-hwan 2020-04-20 04:29:00 +00:00
parent 2f6bd33fc3
commit 121ae9bc76

View File

@ -1111,8 +1111,8 @@ static int fnc_tcgetattr (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) /* this is
md[2].key.ptr = HAWK_T("cflag");
md[2].key.len = 5;
md[2].type = HAWK_VAL_MAP_DATA_INT;
md[2].type_size = HAWK_SIZEOF(t.c_oflag);
md[2].vptr = &t.c_oflag;
md[2].type_size = HAWK_SIZEOF(t.c_cflag);
md[2].vptr = &t.c_cflag;
md[3].key.ptr = HAWK_T("lflag");
md[3].key.len = 5;
@ -1268,7 +1268,7 @@ static int fnc_tcsetraw (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) /* this is
if (rx <= -1) goto fail_with_errno;
t.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
t.c_oflag &= ~OPOST;
t.c_oflag &= ~(OPOST);
t.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
t.c_cflag &= ~(CSIZE | PARENB);
t.c_cflag |= CS8;
@ -4956,6 +4956,13 @@ static inttab_t inttab[] =
{ HAWK_T("TC_LFLAG_ICANON"), { ICANON } },
{ HAWK_T("TC_LFLAG_ISIG"), { ISIG } },
{ HAWK_T("TC_OFLAG_OCRNL"), { OCRNL } },
{ HAWK_T("TC_OFLAG_ONLCR"), { ONLCR } },
{ HAWK_T("TC_OFLAG_ONLRET"), { ONLRET } },
{ HAWK_T("TC_OFLAG_ONOCR"), { ONOCR } },
{ HAWK_T("TC_OFLAG_ONOEOT"), { ONOEOT } },
{ HAWK_T("TC_OFLAG_OPOST"), { OPOST } },
{ HAWK_T("TC_OFLAG_OXTABS"), { OXTABS } },
{ HAWK_T("TC_SADRAIN"), { TCSADRAIN } },
{ HAWK_T("TC_SAFLUSH"), { TCSAFLUSH } },