trying to create fifo that can read and write. but some reason its not going below "O_RDONLY" line. any thoughts?
char *fifo_name = "fifo";
#define 0666
int main()
{
int fd1;
int fd2;
//create fifo
if(mkfifo(fifo_name,FIFO_MODE) == -1)
{
exit(1);
}
//open fifo for read
if((fd1 = open(fifo_name, O_RDONLY)) == -1)
{
exit(1);
}
//------------------------------------------------------------------------------ it doesnt come here
//open fifo for write
if((fd2 = open(fifo_name, O_WRONLY)) == -1)
{
exit(1);
}
}