summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/closeFile.c
diff options
context:
space:
mode:
authorsimonmar <unknown>1999-11-25 16:54:15 +0000
committersimonmar <unknown>1999-11-25 16:54:15 +0000
commit0086477cfe554f9c65ae4c2f1e4e19f4e8c063eb (patch)
tree506ffebc9496dc64bbc5cf129eea5c2ebbd533c6 /ghc/lib/std/cbits/closeFile.c
parent63b4f50cfaa383118c947445e5afb4fff3cd1c91 (diff)
downloadhaskell-0086477cfe554f9c65ae4c2f1e4e19f4e8c063eb.tar.gz
[project @ 1999-11-25 16:54:14 by simonmar]
Incremental cleanups & improvements to the I/O subsystem - Initial fix for problems caused by partial writes to non-blocking file descriptors. To see this bug, run ghc/tests/programs/life_space_leak through a pipe. - remove FILEOBJ_FLUSH, it allegedly has the same meaning as FILEOBJ_WRITE. This fixes a buf in openFd: it erroneously didn't set FILEOBJ_FLUSH on writeable file descriptors. - some ANSIfication
Diffstat (limited to 'ghc/lib/std/cbits/closeFile.c')
-rw-r--r--ghc/lib/std/cbits/closeFile.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ghc/lib/std/cbits/closeFile.c b/ghc/lib/std/cbits/closeFile.c
index 1e94d80a0f..1addd3f3dd 100644
--- a/ghc/lib/std/cbits/closeFile.c
+++ b/ghc/lib/std/cbits/closeFile.c
@@ -1,7 +1,7 @@
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: closeFile.c,v 1.6 1999/07/12 10:43:12 sof Exp $
+ * $Id: closeFile.c,v 1.7 1999/11/25 16:54:14 simonmar Exp $
*
* hClose Runtime Support
*/
@@ -20,9 +20,7 @@
StgInt __really_close_stdfiles=1;
StgInt
-closeFile(ptr,flush_buf)
-StgForeignPtr ptr;
-StgInt flush_buf;
+closeFile(StgForeignPtr ptr, StgInt flush_buf)
{
IOFileObject* fo = (IOFileObject*)ptr;
int rc = 0;
@@ -33,7 +31,7 @@ StgInt flush_buf;
return 0;
}
- if ( flush_buf != 0 && (fo->flags & FILEOBJ_FLUSH) ) {
+ if ( flush_buf != 0 && (fo->flags & FILEOBJ_WRITE) ) {
writeFileObject(ptr,fo->bufWPtr);
}