projects
/
haskell-directory.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
7e5e86a
)
[project @ 2005-01-07 22:24:55 by krasimir]
author
krasimir
<unknown>
Fri, 7 Jan 2005 22:24:55 +0000
(22:24 +0000)
committer
krasimir
<unknown>
Fri, 7 Jan 2005 22:24:55 +0000
(22:24 +0000)
truncate the file only in WriteMode
GHC/Handle.hs
patch
|
blob
|
history
diff --git
a/GHC/Handle.hs
b/GHC/Handle.hs
index
56deea6
..
f79a2cb
100644
(file)
--- a/
GHC/Handle.hs
+++ b/
GHC/Handle.hs
@@
-819,8
+819,10
@@
openFile' filepath mode binary =
-- (so we don't need to worry about removing the newly created file
-- in the event of an error).
#ifndef mingw32_TARGET_OS
- throwErrnoIf (/=0) "openFile"
- (c_ftruncate (fromIntegral fd) 0)
+ if mode == WriteMode
+ then throwErrnoIf (/=0) "openFile"
+ (c_ftruncate (fromIntegral fd) 0)
+ else return 0
#endif
return h