if (!strcmp(name, "TermWidth") ||
!strcmp(name, "TermHeight")) {
struct winsize size;
if (!strcmp(name, "TermWidth") ||
!strcmp(name, "TermHeight")) {
struct winsize size;
- if ((fl = fcntl(1, F_GETFL)) == -1 ||
- fcntl(1, F_SETFL, fl | O_NONBLOCK) == -1) {
+ if ((fl = fcntl(STDOUT_FILENO, F_GETFL)) == -1 ||
+ fcntl(STDOUT_FILENO, F_SETFL, fl | O_NONBLOCK) == -1) {
- if ((fl = fcntl(2, F_GETFL)) == -1 ||
- fcntl(2, F_SETFL, fl | O_NONBLOCK) == -1) {
+ if ((fl = fcntl(STDERR_FILENO, F_GETFL)) == -1 ||
+ fcntl(STDERR_FILENO, F_SETFL, fl | O_NONBLOCK) == -1) {
back->sendok(backhandle) &&
back->sendbuffer(backhandle) < MAX_STDIN_BACKLOG) {
/* If we're OK to send, then try to read from stdin. */
back->sendok(backhandle) &&
back->sendbuffer(backhandle) < MAX_STDIN_BACKLOG) {
/* If we're OK to send, then try to read from stdin. */
}
if (bufchain_size(&stdout_data) > 0) {
/* If we have data for stdout, try to write to stdout. */
}
if (bufchain_size(&stdout_data) > 0) {
/* If we have data for stdout, try to write to stdout. */
}
if (bufchain_size(&stderr_data) > 0) {
/* If we have data for stderr, try to write to stderr. */
}
if (bufchain_size(&stderr_data) > 0) {
/* If we have data for stderr, try to write to stderr. */