+2002-11-05 Sergey Okhapkin <sos@prospect.com.ru>
+
+ * fhandler_serial.cc (fhandler_serial::raw_read): Use correct type for minchars.
+ (fhandler_serial::ioctl): Set errno if the ClearCommError fails.
+ (fhandler_serial::tcsetattr): Use correct value for vmin_.
+ (fhandler_serial::tcgetattr): Ditto.
+
2002-11-05 Thomas Pfaff <tpfaff@gmx.net>
* fhandler_socket.cc (fhandler_socket::recvmsg): Call if from == NULL
class fhandler_serial: public fhandler_base
{
private:
- unsigned int vmin_; /* from termios */
+ size_t vmin_; /* from termios */
unsigned int vtime_; /* from termios */
pid_t pgrp_;
int rts; /* for Windows 9x purposes only */
int tot;
DWORD n;
HANDLE w4[2];
- DWORD minchars = vmin_ ?: ulen;
+ size_t minchars = vmin_ ?: ulen;
w4[0] = io_status.hEvent;
w4[1] = signal_arrived;
inq = st.cbInQue;
else if (!overlapped_armed)
{
- if ((size_t)tot >= minchars)
+ if ((size_t) tot >= minchars)
break;
else if (WaitCommEvent (get_handle (), &ev, &io_status))
{
DWORD ev;
COMSTAT st;
if (ClearCommError (get_handle (), &ev, &st))
- res = -1;
+ {
+ __seterrno ();
+ res = -1;
+ }
else
switch (cmd)
{
break;
case TIOCMGET:
DWORD modem_lines;
- if (GetCommModemStatus (get_handle (), &modem_lines) == 0)
+ if (!GetCommModemStatus (get_handle (), &modem_lines))
{
__seterrno ();
res = -1;
if (t->c_lflag & ICANON)
{
- vmin_ = MAXDWORD;
+ vmin_ = 0;
vtime_ = 0;
}
else
t->c_oflag |= ONLCR;
debug_printf ("vmin_ %d, vtime_ %d", vmin_, vtime_);
- if (vmin_ == MAXDWORD)
+ if (vmin_ == 0)
{
t->c_lflag |= ICANON;
t->c_cc[VTIME] = t->c_cc[VMIN] = 0;