segfault during fclose()

Posted by Hristo on Stack Overflow See other posts from Stack Overflow or by Hristo
Published on 2010-04-03T20:42:23Z Indexed on 2010/04/03 21:03 UTC
Read the original article Hit count: 345

Filed under:
|
|

fclose() is causing a segfault. I have :

char buffer[L_tmpnam];
char *pipeName = tmpnam(buffer);
FILE *pipeFD = fopen(pipeName, "w"); // open for writing
...
...
...
fclose(pipeFD); 

I don't do any file related stuff in the ... yet so that doesn't affect it. However, my MAIN process communicates with another process through shared memory where pipeName is stored; the other process fopen's this pipe for reading to communicated with MAIN.

Any ideas why this is causing a segfault?

Thanks, Hristo

© Stack Overflow or respective owner

Related posts about fopen

Related posts about c