Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions mdstcpip/io_routines/IoRoutinesThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@ static int io_disconnect(Connection *c)
io_pipes_t *p = get_pipes(c);
if (p && p->pth != PARENT_THREAD)
{
#ifdef _WIN32
close_pipe(p->in);
close_pipe(p->out);

#ifdef _WIN32
if (WaitForSingleObject(p->pid, 100) == WAIT_TIMEOUT)
TerminateThread(p->pid, 0);
CloseHandle(p->pid);
#else
pthread_cancel(p->pth);
pthread_join(p->pth, NULL);
close_pipe(p->in);
close_pipe(p->out);
#endif
}
return C_OK;
Expand Down
5 changes: 3 additions & 2 deletions treeshr/TreeOpen.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ EXPORT char *TreePath(char const *tree, char *tree_lower_out)

static char *ReplaceAliasTrees(char *tree_in)
{
char * saveptr = NULL;
size_t buflen = strlen(tree_in) + 1;
char *ans = calloc(1, buflen);
char *tree = strtok(tree_in, ",");
char *tree = strtok_r(tree_in, ",", &saveptr);
size_t i;
while (tree)
{
Expand All @@ -175,7 +176,7 @@ static char *ReplaceAliasTrees(char *tree_in)
strcat(ans, tree);
}
free(treepath);
tree = strtok(0, ",");
tree = strtok_r(0, ",", &saveptr);
}
free(tree_in);
for (i = 0; i < buflen; ++i)
Expand Down