[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#300640: glibc: select() buggy on Hurd



On Sun, Mar 20, 2005 at 11:23:27PM +0100, Marc Dequènes wrote:
>         while ((ret = poll(pfd, 1, 10)) >= 0)
>         {
>                 if (ret == 0)
>                         continue;
>                 if (pfd[0].revents & POLLERR)
>                         break;
>                 if (pfd[0].revents & POLLIN)
>                 {
>                         printf("DATA !\n");
>                         read(fd, &c, 1);
>                 }
>         }

> Result on linux :
> I've got 1 "DATA !" per character (including "\n").

Yes, linux sets POLLERR if the fifo is not readable.

> Result on Hurd :
> I've got an infinite number of "DATA !".

You miss the test for EOF.

> It is like if the select state is not reset after reading.

No, it is just a difference in the implementation. Both behaviours are
okay.

> I tried to find the bug but i need help, this software is not an easy peace.

As it lacks checks of return values, it can't be easy.

Bastian

-- 
Well, Jim, I'm not much of an actor either.

Attachment: signature.asc
Description: Digital signature


Reply to: