From a24f10b51173432fc2ce65c5c40f01f9a25c7243 Mon Sep 17 00:00:00 2001 From: Wolfgang Walter Date: Sat, 20 Dec 2008 16:56:22 +0100 Subject: [PATCH] ntdll: Fix set_XOff and set_XOn. --- dlls/ntdll/serial.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c index 95be78d8b8f..e174c12c1d7 100644 --- a/dlls/ntdll/serial.c +++ b/dlls/ntdll/serial.c @@ -800,39 +800,25 @@ static NTSTATUS set_wait_mask(HANDLE hDevice, DWORD mask) return status; } +/* + * does not change IXOFF but simulates that IXOFF has been received: + */ static NTSTATUS set_XOff(int fd) { - struct termios port; - - if (tcgetattr(fd,&port) == -1) + if (tcflow(fd, TCOOFF)) { - FIXME("tcgetattr on fd %d failed (%s)!\n", fd, strerror(errno)); - return FILE_GetNtStatus(); - - - } - port.c_iflag |= IXOFF; - if (tcsetattr(fd, TCSADRAIN, &port) == -1) - { - FIXME("tcsetattr on fd %d failed (%s)!\n", fd, strerror(errno)); return FILE_GetNtStatus(); } return STATUS_SUCCESS; } +/* + * does not change IXON but simulates that IXON has been received: + */ static NTSTATUS set_XOn(int fd) { - struct termios port; - - if (tcgetattr(fd,&port) == -1) + if (tcflow(fd, TCOON)) { - FIXME("tcgetattr on fd %d failed (%s)!\n", fd, strerror(errno)); - return FILE_GetNtStatus(); - } - port.c_iflag |= IXON; - if (tcsetattr(fd, TCSADRAIN, &port) == -1) - { - FIXME("tcsetattr on fd %d failed (%s)!\n", fd, strerror(errno)); return FILE_GetNtStatus(); } return STATUS_SUCCESS;