Fixing SIGCHLD logic in sftp and removing double close in SIGCHLD implementation

This commit is contained in:
manojampalam 2016-04-05 19:19:10 -07:00
parent 6ec627589f
commit a9a683ed3c
2 changed files with 2 additions and 2 deletions

View File

@ -192,7 +192,7 @@ int waitpid(int pid, int *status, int options) {
ret_id = children.process_id[index]; ret_id = children.process_id[index];
GetExitCodeProcess(process, &exit_code); GetExitCodeProcess(process, &exit_code);
CloseHandle(process); /* process handle will be closed when its removed from list */
sw_remove_child_at_index(index); sw_remove_child_at_index(index);
if (status) if (status)
*status = exit_code; *status = exit_code;

2
sftp.c
View File

@ -2251,8 +2251,8 @@ connect_to_server(char *path, char **args, int *in, int *out)
NORMAL_PRIORITY_CLASS, NULL, NORMAL_PRIORITY_CLASS, NULL,
NULL, &si, &pi) == TRUE) { NULL, &si, &pi) == TRUE) {
sshpid = pi.dwProcessId; sshpid = pi.dwProcessId;
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
sw_add_child(pi.hProcess, pi.dwProcessId);
} }
else else
errno = GetLastError(); errno = GetLastError();