I'm trying to make a simple program which communicates with other programs using named fifo. The first thing i want to do is make a simple server program which creates a random number and writes in a fifo file, and a client program read it. The server is working fine, but my client program is not working properly. He stops in read() function!
if( pipe = open("arqfifo", O_RDONLY, 0 ) == -1 )
You should get a warning doing this.
What is happening, is that the return value of open is being compared with -1, and the result of the comparison is true or false, which is then casted to an int, becoming, 1 or 0, for the assignment to pipe. 0, and 1, are standard input and output.