2 * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
4 * $Id: freeFile.c,v 1.1 1998/04/10 10:54:31 simonm Exp $
12 /* sigh, the FILEs attached to the standard descriptors are
13 handled differently. We don't want them freed via the
14 ForeignObj finaliser, as we probably want to use these
15 before we *really* shut down (dumping stats etc.)
17 void freeStdFile(StgAddr fp)
20 void freeFile(StgAddr fp)
24 if ( fp == NULL || (rc = unlockFile(fileno((FILE *)fp))) ) {
25 /* If the file handle has been explicitly closed
26 * (via closeFile()) or freed, we will have given
27 * up our process lock, so we silently return here.
33 * The finaliser for the FILEs embedded in Handles. The RTS
34 * assumes that the finaliser runs without problems, so all
35 * we can do here is fclose(), and hope nothing went wrong.
37 * Assume fclose() flushes output stream.
40 rc = fclose((FILE *)fp);
41 /* Error or no error, we don't care.. */
45 fprintf(stderr. "Warning: file close ran into trouble\n");