projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 1999-02-03 09:08:01 by simonm]
[ghc-hetmet.git]
/
ghc
/
lib
/
misc
/
SocketPrim.lhs
diff --git
a/ghc/lib/misc/SocketPrim.lhs
b/ghc/lib/misc/SocketPrim.lhs
index
1d2f9c8
..
93a6707
100644
(file)
--- a/
ghc/lib/misc/SocketPrim.lhs
+++ b/
ghc/lib/misc/SocketPrim.lhs
@@
-90,7
+90,7
@@
import Foreign
import IO
import IOExts ( IORef, newIORef, readIORef, writeIORef )
import CString ( unpackNBytesBAIO,
import IO
import IOExts ( IORef, newIORef, readIORef, writeIORef )
import CString ( unpackNBytesBAIO,
- unpackCString, unpackCStringIO,
+ unpackCStringIO,
unpackCStringLenIO,
allocChars
)
unpackCStringLenIO,
allocChars
)
@@
-278,7
+278,7
@@
bindSocket (MkSocket s _family _stype _protocol socketStatus) addr = do
show currentStatus))
else do
addr' <- packSockAddr addr
show currentStatus))
else do
addr' <- packSockAddr addr
- let (_,sz) = boundsOfByteArray addr'
+ let (_,sz) = boundsOfMutableByteArray addr'
status <- _ccall_ bindSocket s addr' sz (isDomainSocket::Int)
case (status::Int) of
-1 -> constructErrorAndFail "bindSocket"
status <- _ccall_ bindSocket s addr' sz (isDomainSocket::Int)
case (status::Int) of
-1 -> constructErrorAndFail "bindSocket"
@@
-313,7
+313,7
@@
connect (MkSocket s _family _stype _protocol socketStatus) addr = do
show currentStatus))
else do
addr' <- packSockAddr addr
show currentStatus))
else do
addr' <- packSockAddr addr
- let (_,sz) = boundsOfByteArray addr'
+ let (_,sz) = boundsOfMutableByteArray addr'
status <- _ccall_ connectSocket s addr' sz (isDomainSocket::Int)
case (status::Int) of
-1 -> constructErrorAndFail "connect"
status <- _ccall_ connectSocket s addr' sz (isDomainSocket::Int)
case (status::Int) of
-1 -> constructErrorAndFail "connect"
@@
-425,7
+425,7
@@
sendTo (MkSocket s _family _stype _protocol status) xs addr = do
show currentStatus))
else do
addr' <- packSockAddr addr
show currentStatus))
else do
addr' <- packSockAddr addr
- let (_,sz) = boundsOfByteArray addr'
+ let (_,sz) = boundsOfMutableByteArray addr'
nbytes <- _ccall_ sendTo__ s xs (length xs) addr' sz
case (nbytes::Int) of
-1 -> constructErrorAndFail "sendTo"
nbytes <- _ccall_ sendTo__ s xs (length xs) addr' sz
case (nbytes::Int) of
-1 -> constructErrorAndFail "sendTo"
@@
-1130,13
+1130,13
@@
allocSockAddr :: Family -> IO (MutableByteArray RealWorld Int, Int)
#ifndef cygwin32_TARGET_OS
allocSockAddr AF_UNIX = do
ptr <- allocChars ``sizeof(struct sockaddr_un)''
#ifndef cygwin32_TARGET_OS
allocSockAddr AF_UNIX = do
ptr <- allocChars ``sizeof(struct sockaddr_un)''
- let (_,sz) = boundsOfByteArray ptr
+ let (_,sz) = boundsOfMutableByteArray ptr
return (ptr, sz)
#endif
allocSockAddr AF_INET = do
ptr <- allocChars ``sizeof(struct sockaddr_in)''
return (ptr, sz)
#endif
allocSockAddr AF_INET = do
ptr <- allocChars ``sizeof(struct sockaddr_in)''
- let (_,sz) = boundsOfByteArray ptr
+ let (_,sz) = boundsOfMutableByteArray ptr
return (ptr, sz)
-------------------------------------------------------------------------------
return (ptr, sz)
-------------------------------------------------------------------------------