2 % (c) The GRASP/AQUA Project, Glasgow University, 1997
4 \subsection[freeFile.lc]{Giving up files}
11 /* sigh, the standard channels are handled differently,
12 we don't want them freed via the ForeignObj finaliser,
13 as we probably want to use these channels before we
14 *really* shutdown (dumping stats etc.)
16 void freeStdChannel(fp)
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");