C coding question
Micah
micahjon at ywave.com
Wed May 17 11:21:15 PDT 2006
Andy Greenwood wrote:
> I am helping someone work on porting some code to Freebsd, and the
> code below works on Linux, but not on FreeBSD (compiles, but gives
> Segmentation Fault: 11). I'm not sure where the problem is, and any
> pointers would be much appreciated.
That's funny, it doesn't even compile on my freebsd:
trisha% cat test.c
/* Check if we must stop */
if(tf_stat_file != NULL)
{
tf_stat = fopen(tf_stat_file, "r");
if (tf_stat != NULL)
{
/* Get state */
stat_state=fgetc(tf_stat);
/* Torrentflux asked to shutdown the torrent */
if (stat_state == '0')
{
mustDie = 1;
}
}
fclose(tf_stat);
}
trisha% cc test.c
test.c:2: error: syntax error before "if"
IOW, if you expect usable help please supply some context.
Later,
Micah
More information about the freebsd-questions
mailing list