-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to Issue 698 and other misc changes #208
Conversation
contrib/win32/win32compat/termio.c
Outdated
@@ -107,7 +107,8 @@ ReadThread(_In_ LPVOID lpParameter) | |||
|
|||
if (!ReadFile(WINHANDLE(pio), pio->read_details.buf, | |||
pio->read_details.buf_size, &read_status.transferred, NULL)) { | |||
read_status.error = GetLastError(); | |||
debug4("ReadThread - ReadFile failed %d, io:%p", GetLastError(), pio); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor suggest: error:%d
contrib/win32/win32compat/termio.c
Outdated
@@ -126,7 +127,8 @@ ReadThread(_In_ LPVOID lpParameter) | |||
} else { | |||
if (!ReadFile(WINHANDLE(pio), pio->read_details.buf, | |||
pio->read_details.buf_size, &read_status.transferred, NULL)) { | |||
read_status.error = GetLastError(); | |||
debug4("ReadThread - ReadFile failed %d, io:%p", GetLastError(), pio); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor suggest: error:%d
contrib/win32/win32compat/termio.c
Outdated
@@ -209,7 +211,7 @@ WriteThread(_In_ LPVOID lpParameter) | |||
if (!WriteFile(WINHANDLE(pio), pio->write_details.buf, write_status.to_transfer, | |||
&write_status.transferred, NULL)) { | |||
write_status.error = GetLastError(); | |||
debug("WriteThread - ReadFile WriteFile %d, io:%p", GetLastError(), pio); | |||
debug4("WriteThread - ReadFile WriteFile %d, io:%p", GetLastError(), pio); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ReadFile from the mesage. add error:%d
if (!SetInformationJobObject(job, JobObjectExtendedLimitInformation, &job_info, sizeof(job_info)) || | ||
!AssignProcessToJobObject(job, GetCurrentProcess())) { | ||
printf_s("cannot associate job object: %d", GetLastError()); | ||
return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the handle is closed when process exits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right.
Fix to PowerShell/Win32-OpenSSH#698 - Create job object, add ssh-shellhost and ensure all its child process and tied to its lifetime.
Other changes include changes to debug* statements in posix adapter that may cause recursion/stack overflow issues.