version 1.325, 2019/06/26 22:29:43 |
version 1.326, 2019/06/28 13:35:04 |
|
|
} |
} |
|
|
ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp); |
ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp); |
if (ret < 0) { |
if (ret == -1) { |
/* |
/* |
* We have to clear the select masks, because we return. |
* We have to clear the select masks, because we return. |
* We have to return, because the mainloop checks for the flags |
* We have to return, because the mainloop checks for the flags |
|
|
* There is a kernel bug on Solaris that causes select to |
* There is a kernel bug on Solaris that causes select to |
* sometimes wake up even though there is no data available. |
* sometimes wake up even though there is no data available. |
*/ |
*/ |
if (len < 0 && (errno == EAGAIN || errno == EINTR)) |
if (len == -1 && (errno == EAGAIN || errno == EINTR)) |
len = 0; |
len = 0; |
|
|
if (len < 0) { |
if (len == -1) { |
/* |
/* |
* An error has encountered. Perhaps there is a |
* An error has encountered. Perhaps there is a |
* network problem. |
* network problem. |
|
|
|
|
/* Fork into background. */ |
/* Fork into background. */ |
pid = fork(); |
pid = fork(); |
if (pid < 0) { |
if (pid == -1) { |
error("fork: %.100s", strerror(errno)); |
error("fork: %.100s", strerror(errno)); |
continue; |
continue; |
} |
} |
|
|
struct winsize ws; |
struct winsize ws; |
|
|
/* Store window size in the packet. */ |
/* Store window size in the packet. */ |
if (ioctl(in_fd, TIOCGWINSZ, &ws) < 0) |
if (ioctl(in_fd, TIOCGWINSZ, &ws) == -1) |
memset(&ws, 0, sizeof(ws)); |
memset(&ws, 0, sizeof(ws)); |
|
|
channel_request_start(ssh, id, "pty-req", 1); |
channel_request_start(ssh, id, "pty-req", 1); |