summaryrefslogtreecommitdiff
path: root/ghc/lib/std/cbits/flushFile.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/flushFile.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/flushFile.c')
-rw-r--r--ghc/lib/std/cbits/flushFile.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/ghc/lib/std/cbits/flushFile.c b/ghc/lib/std/cbits/flushFile.c
index 190d78a465..4416559a33 100644
--- a/ghc/lib/std/cbits/flushFile.c
+++ b/ghc/lib/std/cbits/flushFile.c
@@ -1,7 +1,7 @@
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: flushFile.c,v 1.5 1999/09/19 19:26:14 sof Exp $
+ * $Id: flushFile.c,v 1.6 1999/11/25 16:54:14 simonmar Exp $
*
* hFlush Runtime Support
*/
@@ -10,13 +10,12 @@
#include "stgio.h"
StgInt
-flushFile(ptr)
-StgForeignPtr ptr;
+flushFile(StgForeignPtr ptr)
{
IOFileObject* fo = (IOFileObject*)ptr;
int rc = 0;
- if ( (fo->flags & FILEOBJ_FLUSH) && FILEOBJ_NEEDS_FLUSHING(fo) ) {
+ if ( (fo->flags & FILEOBJ_WRITE) && FILEOBJ_NEEDS_FLUSHING(fo) ) {
rc = writeBuffer(ptr,fo->bufWPtr - fo->bufRPtr);
}
@@ -24,8 +23,7 @@ StgForeignPtr ptr;
}
StgInt
-flushBuffer(ptr)
-StgForeignPtr ptr;
+flushBuffer(StgForeignPtr ptr)
{
IOFileObject* fo = (IOFileObject*)ptr;
int rc = 0;
@@ -57,8 +55,7 @@ StgForeignPtr ptr;
the solution of leaving this to the programmer!)
*/
StgInt
-flushReadBuffer(ptr)
-StgForeignPtr ptr;
+flushReadBuffer(StgForeignPtr ptr)
{
IOFileObject* fo = (IOFileObject*)ptr;
int delta;
@@ -81,8 +78,7 @@ StgForeignPtr ptr;
}
void
-flushConnectedBuf(ptr)
-StgForeignPtr ptr;
+flushConnectedBuf(StgForeignPtr ptr)
{
StgInt rc;
IOFileObject* fo = (IOFileObject*)ptr;