continue;
die("select failed: %s\n", strerror(errno));
}
- if (FD_ISSET(cmdfd, &rfd))
- lim = ttyread();
if (FD_ISSET(cmdfd, &wfd)) {
/*
- * Only write 256 bytes at maximum. This seems to be a
- * reasonable value for a serial line. Bigger values
- * might clog the I/O.
+ * Only write the bytes written by ttywrite() or the
+ * default of 256. This seems to be a reasonable value
+ * for a serial line. Bigger values might clog the I/O.
*/
- if ((r = write(cmdfd, s, (n < 256)? n : 256)) < 0)
+ if ((r = write(cmdfd, s, (n < lim)? n : lim)) < 0)
goto write_error;
if (r < n) {
/*
break;
}
}
+ if (FD_ISSET(cmdfd, &rfd))
+ lim = ttyread();
}
return;
void
xhints(void)
{
- XClassHint class = {opt_class ? opt_class : termname, termname};
+ XClassHint class = {termname, opt_class ? opt_class : termname};
XWMHints wm = {.flags = InputHint, .input = 1};
XSizeHints *sizeh = NULL;