Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 2006 21:47:35 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Andy Greenwood <greenwood.andy@gmail.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: C coding question
Message-ID:  <20060517184735.GB19098@gothmog.pc>
In-Reply-To: <3ee9ca710605171109i57ae4064x702216a1619d6c41@mail.gmail.com>
References:  <3ee9ca710605171109i57ae4064x702216a1619d6c41@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2006-05-17 14:09, Andy Greenwood <greenwood.andy@gmail.com> 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.
>
>        /* 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);
>        }

Please post a complete, compilable program or at least details about
where we can find the full source.  This way it's impossible to find out
where the bug is and why the segmentation fault happens.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060517184735.GB19098>