[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lib/poll.c, win32 SIGHUP on pipes
From: |
Erik Faye-Lund |
Subject: |
lib/poll.c, win32 SIGHUP on pipes |
Date: |
Mon, 23 Aug 2010 00:32:41 +0200 |
I've recently looked into replacing the poll-emulation in Git for
Windows with the code from gnulib, due to the improved pipe-support in
gnulib.
However, I've noticed that win32_compute_revents() never returns
SIGHUP for FILE_TYPE_PIPE, which is something the code I'm trying to
port currently depends on. What seems to happen is the following: one
of the pipe-ends is closed, and thus PeekNamedPipe() fails.
win32_compute_revents() mistakenly believes that the failure means
that the pipe can be written because NtQueryInformationFile succeeds
and returns 8192 for both fpli.WriteQuotaAvailable and
fpli.OutboundQuota.
In my case, a simple "happened |= POLLHUP;"-hack in the error-case
solves the issue in this particular case, but this is obviously not
correct in the general case.
My guess is that a proper solution would be to find device a robust
way of checking if a pipe is closed or not. I haven't looked much into
this yet, but at least GetNamedPipeInfo() doesn't seem to error out on
my pipe.
Thoughts?
- lib/poll.c, win32 SIGHUP on pipes,
Erik Faye-Lund <=