@@ -54,16 +54,6 @@ fhandler_pipe::set_pipe_non_blocking (bool nonblocking)
5454 NTSTATUS status;
5555 IO_STATUS_BLOCK io;
5656 FILE_PIPE_INFORMATION fpi;
57- bool was_blocking_read_pipe_new = was_blocking_read_pipe;
58-
59- if (get_device () == FH_PIPER && nonblocking && !was_blocking_read_pipe)
60- {
61- status = NtQueryInformationFile (get_handle (), &io, &fpi, sizeof fpi,
62- FilePipeInformation);
63- if (NT_SUCCESS (status))
64- was_blocking_read_pipe_new =
65- (fpi.CompletionMode == FILE_PIPE_QUEUE_OPERATION );
66- }
6757
6858 fpi.ReadMode = FILE_PIPE_BYTE_STREAM_MODE ;
6959 fpi.CompletionMode = nonblocking ? FILE_PIPE_COMPLETE_OPERATION
@@ -72,11 +62,6 @@ fhandler_pipe::set_pipe_non_blocking (bool nonblocking)
7262 FilePipeInformation);
7363 if (!NT_SUCCESS (status))
7464 debug_printf (" NtSetInformationFile(FilePipeInformation): %y" , status);
75- else
76- {
77- was_blocking_read_pipe = was_blocking_read_pipe_new;
78- is_blocking_read_pipe = !nonblocking;
79- }
8065}
8166
8267int
@@ -110,8 +95,6 @@ fhandler_pipe::init (HANDLE f, DWORD a, mode_t mode, int64_t uniq_id)
11095 even with FILE_SYNCHRONOUS_IO_NONALERT. */
11196 set_pipe_non_blocking (get_device () == FH_PIPER ?
11297 true : is_nonblocking ());
113- was_blocking_read_pipe = false ;
114-
11598 return 1 ;
11699}
117100
@@ -306,9 +289,6 @@ fhandler_pipe::raw_read (void *ptr, size_t& len)
306289 if (!len)
307290 return ;
308291
309- if (is_blocking_read_pipe)
310- set_pipe_non_blocking (true );
311-
312292 DWORD timeout = is_nonblocking () ? 0 : INFINITE ;
313293 DWORD waitret = cygwait (read_mtx, timeout);
314294 switch (waitret)
@@ -741,8 +721,6 @@ fhandler_pipe::close ()
741721 CloseHandle (query_hdl);
742722 if (query_hdl_close_req_evt)
743723 CloseHandle (query_hdl_close_req_evt);
744- if (was_blocking_read_pipe)
745- set_pipe_non_blocking (false );
746724 int ret = fhandler_base::close ();
747725 ReleaseMutex (hdl_cnt_mtx);
748726 CloseHandle (hdl_cnt_mtx);
@@ -1399,7 +1377,6 @@ fhandler_pipe::spawn_worker (int fileno_stdin, int fileno_stdout,
13991377 {
14001378 fhandler_pipe *pipe = (fhandler_pipe *)(fhandler_base *) cfd;
14011379 pipe->set_pipe_non_blocking (false );
1402- need_send_noncygchld_sig = true ;
14031380 }
14041381
14051382 /* If multiple writers including non-cygwin app exist, the non-cygwin
@@ -1425,21 +1402,3 @@ fhandler_pipe::spawn_worker (int fileno_stdin, int fileno_stdout,
14251402 t->kill_pgrp (__SIGNONCYGCHLD);
14261403 }
14271404}
1428-
1429- void
1430- fhandler_pipe::sigproc_worker (void )
1431- {
1432- cygheap_fdenum cfd (false );
1433- while (cfd.next () >= 0 )
1434- if (cfd->get_dev () == FH_PIPEW )
1435- {
1436- fhandler_pipe *pipe = (fhandler_pipe *)(fhandler_base *) cfd;
1437- if (pipe->need_close_query_hdl ())
1438- pipe->close_query_handle ();
1439- }
1440- else if (cfd->get_dev () == FH_PIPER )
1441- {
1442- fhandler_pipe *pipe = (fhandler_pipe *)(fhandler_base *) cfd;
1443- pipe->is_blocking_read_pipe = true ;
1444- }
1445- }
0 commit comments