hello!
this little program get named fifo as arguments and print whatever someone will write into the pipes. Example:

Code:
mkfifo fifo1
mkfifo fifo2
./es1 fifo1 fifo2

cat > fifo1
write here and my program will print out the lines
i used a select to block onto the pipes. the strange thing is that, if i open the pipe in rdonly, and i write a char into the pipe (with cat, e.g.) and quit that program (ctrl+c on cat), select stucks and say that the named pipe is still ready for reading: so i continue to read 0 bytes from it (and cpu goes to 99%). but if i open the pipe in RDWR, select (and the whole program) goes normal (it will block if i quit cat). why?

thank you very much