Replace the fopen call with a malloc call. Allocate a few megs of memory, and see if it makes it hang. If it doesn't, call free.

You might also consider opening your log file ahead of time, and just leaving it open for the duration of the program.


Quzah.