2 % (c) The GRASP/AQUA Project, Glasgow University, 1997
4 \subsection[freeFile.lc]{Giving up files}
11 /* sigh, the FILEs attached to the standard descriptors are
12 handled differently. We don't want them freed via the
13 ForeignObj finaliser, as we probably want to use these
14 before we *really* shut down (dumping stats etc.)
25 if ( fp == NULL || (rc = unlockFile(fileno((FILE *)fp))) ) {
26 /* If the file handle has been explicitly closed
27 * (via closeFile()) or freed, we will have given
28 * up our process lock, so we silently return here.
34 * The finaliser for the FILEs embedded in Handles. The RTS
35 * assumes that the finaliser runs without problems, so all
36 * we can do here is fclose(), and hope nothing went wrong.
38 * Assume fclose() flushes output stream.
41 rc = fclose((FILE *)fp);
42 /* Error or no error, we don't care.. */
46 fprintf(stderr. "Warning: file close ran into trouble\n");