Program quits if pipe is closed
- by givemelight
I am trying to write to a pipe using C++. The following code gets called in an extra thread:
void writeToPipe()
{
int outfifo;
char buf[100];
char outfile[] = "out";
mknod(outfile, S_IFIFO | 0666, 0);
if ((outfifo = open(outfile, O_WRONLY)) < 0) {
perror("Opening output fifo failed");
return false;
}
…