Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 2006 14:09:16 -0400
From:      "Andy Greenwood" <greenwood.andy@gmail.com>
To:        "FreeBSD Questions" <freebsd-questions@freebsd.org>
Subject:   C coding question
Message-ID:  <3ee9ca710605171109i57ae4064x702216a1619d6c41@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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 !=3D NULL)
        {
            tf_stat =3D fopen(tf_stat_file, "r");
            if (tf_stat !=3D NULL)
            {
                /* Get state */
                stat_state=3Dfgetc(tf_stat);

                /* Torrentflux asked to shutdown the torrent */
                if (stat_state =3D=3D '0')
                {
                    mustDie =3D 1;
                }
            }
            fclose(tf_stat);
        }



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