Skip to content
This repository was archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
workaround for microsoft/WSL#419
Browse files Browse the repository at this point in the history
  • Loading branch information
xilun committed May 24, 2016
1 parent 5e32363 commit 51902d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions caller/wrun.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,13 +611,13 @@ static void fs_init_accept_as_needed(struct forward_state *fs, struct listening_
fd_set_nonblock(std_fileno);
int sock = accept_and_close_listener(lsock);
if (std_fileno == STDIN_FILENO) {
shutdown(sock, SHUT_RD);
// shutdown(sock, SHUT_RD);
int flags = FORWARD_STATE_OUT_IS_SOCKET;
if (std_fd_info[std_fileno].is_socket)
flags |= FORWARD_STATE_IN_IS_SOCKET;
forward_state_init(fs, std_fileno, sock, flags);
} else { // STDOUT_FILENO or STDERR_FILENO
shutdown(sock, SHUT_WR);
// shutdown(sock, SHUT_WR);
int flags = FORWARD_STATE_IN_IS_SOCKET;
if (std_fd_info[std_fileno].is_socket)
flags |= FORWARD_STATE_OUT_IS_SOCKET;
Expand Down
4 changes: 2 additions & 2 deletions outbash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class OutbashStdRedirects : public StdRedirects
m_redir_connect_events.at(i) = std::move(conn_ev);
} else {
conn_ev.close();
::shutdown(sock.get(), i == REDIR_STDIN ? SD_SEND : SD_RECEIVE);
// ::shutdown(sock.get(), i == REDIR_STDIN ? SD_SEND : SD_RECEIVE);
sock.set_to_blocking();
adopt_handle((role_e)i, (HANDLE)sock.release());
}
Expand Down Expand Up @@ -473,7 +473,7 @@ class OutbashStdRedirects : public StdRedirects
unsigned i = idx_from_evhandle(wait_handles.at(wr - WAIT_OBJECT_0));
m_redir_connect_events.at(i).close();
SOCKET s_i = (SOCKET)get_handle((role_e)i);
::shutdown(s_i, i == REDIR_STDIN ? SD_SEND : SD_RECEIVE);
// ::shutdown(s_i, i == REDIR_STDIN ? SD_SEND : SD_RECEIVE);
CUniqueSocket::set_to_blocking(s_i);
}
}
Expand Down

0 comments on commit 51902d6

Please sign in to comment.