MAGIC Magic Mailing List
 
 

From: Guntram Wolski (gkw AT taunetworks DOT com)
Date: Mon Oct 07 2002 - 20:41:45 EDT

  • Next message: Patrick Hekeno: "Fwd: Re: FreeBSD 4.6 and Magic 7.1, "gmake[2]: *** [signals.o] Error 1""

    Found a bug in calma/CalmaWrite.c.
    
    Looking at the 7.1 CVS code for calma/CalmaWrite.c, in
    the CalmaWrite function, I see an fclose() at line 247:
    
        /* Finish up by outputting the end-of-library marker */
        calmaOutRH(4, CALMA_ENDLIB, CALMA_NODATA, f);
        fflush(f);
        good = !ferror(f);
        (void) fclose(f);
    
    Unfortunately, the fclose() gets called again immediately after
    the CalmaWrite() in the parent function commands/CmdCD.c:
    
        if (!CalmaWrite(rootDef, f))
        {
            TxError("I/O error in writing file %s.\n", namep);
            TxError("File may be incompletely written.\n");
        }
        (void) fclose(f);
    }
    
    This has led to crashes on my Redhat Linux.
    One of them has to go.  I chose to remove the one in CalmaWrite()
    as the open actually happens in the calling routine.
    
    --G
    Guntram Wolski				       gkw AT taunetworks DOT com
    Tau Networks                      		 (831)438-5300x112
    269 Mt. Hermon Road, Ste 207
    Scotts Valley, CA 95066				FAX:(831) 438-3163
    


  •  
     
    Questions? Contact Rajit Manohar
    cornell logo