some bug fixes

Fifer, Eric
Mon Mar 13 07:43:00 GMT 2000

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 (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

This is an example that demonstrates the bug:

#include <sys/select.h>

    int fd[2];
    fd_set fde;
    int n;
    struct timeval timeout;

    pipe(fd); /* 0 read, 1 write */
    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);


Eric Fifer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygwin.pipe.patch
Type: text/x-diff
Size: 2730 bytes
Desc: not available
URL: <>

More information about the Cygwin-developers mailing list