Do not use errno on Windows in the `os` module.

This commit is contained in:
Dominik Picheta
2015-07-11 14:01:53 +01:00
parent b6afa42793
commit a312808e38

View File

@@ -1019,7 +1019,7 @@ proc moveFile*(source, dest: string) {.rtl, extern: "nos$1",
let d = newWideCString(dest)
if moveFileW(s, d, 0'i32) == 0'i32: raiseOSError(osLastError())
else:
if moveFileA(source, dest, 0'i32) == 0'i32: raiseOSError(osLastError(),$strerror(errno))
if moveFileA(source, dest, 0'i32) == 0'i32: raiseOSError(osLastError())
else:
if c_rename(source, dest) != 0'i32:
raiseOSError(osLastError(), $strerror(errno))