This is the mail archive of the
cygwin-developers@sourceware.cygnus.com
mailing list for the Cygwin project.
RE: some bug fixes
- To: 'Chris Faylor' <cgf at cygnus dot com>
- Subject: RE: some bug fixes
- From: "Fifer, Eric" <EFifer at sanwaint dot com>
- Date: Mon, 13 Mar 2000 15:41:34 -0000
- Cc: "'cygwin-developers at sourceware dot cygnus dot com'" <cygwin-developers at sourceware dot cygnus dot com>
This is an old thread, but I'd like to try again to get
a minor bug fixed. I changed the patch so that it doesn't
need to use strcmp on fh->get_name().
With the attached patch, in select.cc (peek_pipe) PeekNamedPipe
should not be called on FH_PIPEW (the write end of a pipe) because
it will fail incorrectly (PeekNamedPipe fails with ACCESS_DENIED
on a handle with only GENERIC_WRITE access). The remainder of
the patch changes the generic use of FH_PIPE to FH_PIPER and
FH_PIPEW.
This is an example that demonstrates the bug:
#include <sys/select.h>
main()
{
int fd[2];
fd_set fde;
int n;
struct timeval timeout;
pipe(fd); /* 0 read, 1 write */
FD_ZERO(&fde);
FD_SET(fd[1], &fde);
timeout.tv_sec = 1; timeout.tv_usec = 0;
n = select(16, NULL, NULL, &fde, &timeout);
printf("n = %d\n", n);
}
Thanks.
Eric Fifer
cygwin.pipe.patch