Greetings,
I have a windows C program problem that has me baffled. The section of the code in question is doing a recursive loop to search through a directory structure. The program (on one machine) doesn't complete. There is nothing in the event logs and no crash file or stackdump.
I added a print statement to see where it might be failing. The last entry in the log file is not even a complete entry.
Here' the snippet of code:
Code:
// if this is a directory, call comp_files recursively,
// unless it is a Junction point, which we don't want to recurse
if ( S_ISDIR(fileStat.st_mode) )
{
if (S_ISLNK(fileStat.st_mode)) //if junction point, continue to next entry
{
continue;
}
else
{
sprintf(nextSrcDirCyg, "%s%s", srcDirCyg, shadDirEntry->d_name);
sprintf(nextShadDirCyg, "%s%s", shadDirCyg, shadDirEntry->d_name);
strcat(nextSrcDirCyg,"/");
strcat(nextShadDirCyg,"/");
//recursively call comp_files with new directory name
comp_files(nextSrcDirCyg, nextShadDirCyg);
sprintf(logstring, "returning from recursive call for directory %s", nextShadDirCyg);
logprint(logstring);
fflush(locallogfile);
}
}
Here are the last few lines from the log. Note that the last line of the log is not even complete in spite of a fflush to the log.
Mon Nov 4 20:35:25 2013 returning from recursive call for directory /cygdrive/G/apteryx/pats/THALBOB_3976/
Mon Nov 4 20:35:25 2013 returning from recursive call for directory /cygdrive/G/apteryx/pats/TIMMESYDNEY_6648/
Mon Nov 4 20:35:25 2013 returning from recursive call for directory /cygdrive/G/apteryx/pats/TRAMPEBETTYA_5371/
Mon Nov 4 20:35:25 2013 returni
Any suggestions on how to diagnose this will be greatly appreciated.
Leon