diff options
author | Araq <rumpf_a@web.de> | 2011-06-17 01:04:33 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-06-17 01:04:33 +0200 |
commit | 849208d779e860230bb8682b3b356ba2942dd889 (patch) | |
tree | bc6428bf782f9d47e121177c0e5f300062b3f1aa /lib/pure/osproc.nim | |
parent | dc6a80bd1d36b158a090ed0fb622140856be3dfe (diff) | |
download | Nim-849208d779e860230bb8682b3b356ba2942dd889.tar.gz |
got rid of unsound co/contravariance in procvars
Diffstat (limited to 'lib/pure/osproc.nim')
-rwxr-xr-x | lib/pure/osproc.nim | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index d74cf1fdc..de5317717 100755 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -232,10 +232,11 @@ when defined(Windows) and not defined(useNimRtl): handle: THandle atTheEnd: bool - proc hsClose(s: PFileHandleStream) = nil # nothing to do here - proc hsAtEnd(s: PFileHandleStream): bool = return s.atTheEnd + proc hsClose(s: PStream) = nil # nothing to do here + proc hsAtEnd(s: PStream): bool = return PFileHandleStream(s).atTheEnd - proc hsReadData(s: PFileHandleStream, buffer: pointer, bufLen: int): int = + proc hsReadData(s: PStream, buffer: pointer, bufLen: int): int = + var s = PFileHandleStream(s) if s.atTheEnd: return 0 var br: int32 var a = winlean.ReadFile(s.handle, buffer, bufLen, br, nil) @@ -246,7 +247,8 @@ when defined(Windows) and not defined(useNimRtl): s.atTheEnd = br < bufLen result = br - proc hsWriteData(s: PFileHandleStream, buffer: pointer, bufLen: int) = + proc hsWriteData(s: PStream, buffer: pointer, bufLen: int) = + var s = PFileHandleStream(s) var bytesWritten: int32 var a = winlean.writeFile(s.handle, buffer, bufLen, bytesWritten, nil) if a == 0: OSError() @@ -507,7 +509,7 @@ elif not defined(useNimRtl): quit("execve call failed: " & $strerror(errno)) # Parent process. Copy process information. if poEchoCmd in options: - echo(command & " " & join(args, " ")) + echo(command, " ", join(args, " ")) result.id = pid result.inputHandle = p_stdin[writeIdx] |