write_serial (int fd, guchar *buffer, int offset, int count, int timeout)
{
struct pollfd pinfo;
+ guint32 n;
pinfo.fd = fd;
pinfo.events = POLLOUT;
pinfo.revents = POLLOUT;
-
- struct timeval tmval;
- fd_set writefs;
- guint32 n;
-
n = count;
- FD_SET(fd, &writefs);
- tmval.tv_sec = timeout / 1000;
- tmval.tv_usec = (timeout - tmval.tv_sec) * 1000;
-
while (n > 0)
{
size_t t;
- if (timeout > 0) {
+ if (timeout != 0) {
int c;
while ((c = poll (&pinfo, 1, timeout)) == -1 && errno == EINTR)
case Even: /* Even */
newtio.c_cflag &= ~(PARODD);
+ newtio.c_cflag |= (PARENB);
break;
case Mark: /* Mark */