Skip to content

Commit 6c5f1c6

Browse files
committed
Removed redundant code in shell-host
1 parent 2de04bf commit 6c5f1c6

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

contrib/win32/win32compat/shell-host.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ consoleEvent* head = NULL;
6363
consoleEvent* tail = NULL;
6464

6565
BOOL isRedirected = FALSE;
66-
BOOL istty = FALSE;
6766
BOOL bRet = FALSE;
6867
BOOL bNoScrollRegion = FALSE;
6968
BOOL bStartup = TRUE;
@@ -75,8 +74,6 @@ HANDLE child_err = INVALID_HANDLE_VALUE;
7574
HANDLE pipe_in = INVALID_HANDLE_VALUE;
7675
HANDLE pipe_out = INVALID_HANDLE_VALUE;
7776
HANDLE pipe_err = INVALID_HANDLE_VALUE;
78-
HANDLE child_pipe_read = INVALID_HANDLE_VALUE;
79-
HANDLE child_pipe_write = INVALID_HANDLE_VALUE;
8077
HANDLE child = INVALID_HANDLE_VALUE;
8178
HANDLE hConsoleBuffer = INVALID_HANDLE_VALUE;
8279

@@ -813,10 +810,6 @@ DWORD WINAPI ProcessPipes(LPVOID p) {
813810
DWORD rd = 0, wr = 0, i = -1;
814811

815812
GOTO_CLEANUP_ON_FALSE(ReadFile(pipe_in, buf, 128, &rd, NULL));
816-
if (!istty) { /* no tty, just send it accross */
817-
GOTO_CLEANUP_ON_FALSE(WriteFile(child_pipe_write, buf, rd, &wr, NULL));
818-
continue;
819-
}
820813

821814
bStartup = FALSE;
822815

@@ -1076,12 +1069,6 @@ int wmain(int ac, wchar_t **av) {
10761069

10771070
memset(&sa, 0, sizeof(SECURITY_ATTRIBUTES));
10781071
sa.bInheritHandle = TRUE;
1079-
if (!CreatePipe(&child_pipe_read, &child_pipe_write, &sa, 128))
1080-
return -1;
1081-
1082-
/* A console is attached if a tty is requested */
1083-
if (!AllocConsole())
1084-
istty = TRUE;
10851072

10861073
/* create job to hold all child processes */
10871074
{
@@ -1116,9 +1103,8 @@ int wmain(int ac, wchar_t **av) {
11161103

11171104
if (isRedirected)
11181105
{
1119-
/* disable inheritance on child_pipe_write and pipe_in*/
1106+
/* disable inheritance on pipe_in*/
11201107
GOTO_CLEANUP_ON_FALSE(SetHandleInformation(pipe_in, HANDLE_FLAG_INHERIT, 0));
1121-
GOTO_CLEANUP_ON_FALSE(SetHandleInformation(child_pipe_write, HANDLE_FLAG_INHERIT, 0));
11221108
}
11231109

11241110
/*TODO - pick this up from system32*/
@@ -1147,10 +1133,6 @@ int wmain(int ac, wchar_t **av) {
11471133
Sleep(1000);
11481134
}
11491135

1150-
/* close unwanted handles*/
1151-
CloseHandle(child_pipe_read);
1152-
child_pipe_read = INVALID_HANDLE_VALUE;
1153-
11541136
/* monitor child exist */
11551137
child = pi.hProcess;
11561138
monitor_thread = CreateThread(NULL, 0, MonitorChild, NULL, 0, NULL);

0 commit comments

Comments
 (0)