aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/poll.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/win32/poll.c b/win32/poll.c
index b39732887..fb95adea7 100644
--- a/win32/poll.c
+++ b/win32/poll.c
@@ -170,14 +170,17 @@ windows_compute_revents (HANDLE h, int *p_sought)
170 INPUT_RECORD *irbuffer; 170 INPUT_RECORD *irbuffer;
171 DWORD avail, nbuffer; 171 DWORD avail, nbuffer;
172 BOOL bRet; 172 BOOL bRet;
173#if 0
173 IO_STATUS_BLOCK iosb; 174 IO_STATUS_BLOCK iosb;
174 FILE_PIPE_LOCAL_INFORMATION fpli; 175 FILE_PIPE_LOCAL_INFORMATION fpli;
175 static PNtQueryInformationFile NtQueryInformationFile; 176 static PNtQueryInformationFile NtQueryInformationFile;
176 static BOOL once_only; 177 static BOOL once_only;
178#endif
177 179
178 switch (GetFileType (h)) 180 switch (GetFileType (h))
179 { 181 {
180 case FILE_TYPE_PIPE: 182 case FILE_TYPE_PIPE:
183#if 0
181 if (!once_only) 184 if (!once_only)
182 { 185 {
183 NtQueryInformationFile = (PNtQueryInformationFile) 186 NtQueryInformationFile = (PNtQueryInformationFile)
@@ -185,6 +188,7 @@ windows_compute_revents (HANDLE h, int *p_sought)
185 "NtQueryInformationFile"); 188 "NtQueryInformationFile");
186 once_only = TRUE; 189 once_only = TRUE;
187 } 190 }
191#endif
188 192
189 happened = 0; 193 happened = 0;
190 if (PeekNamedPipe (h, NULL, 0, NULL, &avail, NULL) != 0) 194 if (PeekNamedPipe (h, NULL, 0, NULL, &avail, NULL) != 0)
@@ -197,6 +201,14 @@ windows_compute_revents (HANDLE h, int *p_sought)
197 201
198 else 202 else
199 { 203 {
204 /* The writability of a pipe can't be detected reliably on Windows.
205 * Just say it's OK.
206 *
207 * Details:
208 *
209 * https://github.com/git-for-windows/git/commit/94f4d01932279c419844aa708bec31a26056bc6b
210 */
211#if 0
200 /* It was the write-end of the pipe. Check if it is writable. 212 /* It was the write-end of the pipe. Check if it is writable.
201 If NtQueryInformationFile fails, optimistically assume the pipe is 213 If NtQueryInformationFile fails, optimistically assume the pipe is
202 writable. This could happen on Windows 9x, where 214 writable. This could happen on Windows 9x, where
@@ -214,6 +226,7 @@ windows_compute_revents (HANDLE h, int *p_sought)
214 || fpli.WriteQuotaAvailable >= PIPE_BUF 226 || fpli.WriteQuotaAvailable >= PIPE_BUF
215 || (fpli.OutboundQuota < PIPE_BUF && 227 || (fpli.OutboundQuota < PIPE_BUF &&
216 fpli.WriteQuotaAvailable == fpli.OutboundQuota)) 228 fpli.WriteQuotaAvailable == fpli.OutboundQuota))
229#endif
217 happened |= *p_sought & (POLLOUT | POLLWRNORM | POLLWRBAND); 230 happened |= *p_sought & (POLLOUT | POLLWRNORM | POLLWRBAND);
218 } 231 }
219 return happened; 232 return happened;