Do not use errno on Windows in the `os` module.
This commit is contained in:
parent
b6afa42793
commit
a312808e38
1 changed files with 1 additions and 1 deletions
|
|
@ -1019,7 +1019,7 @@ proc moveFile*(source, dest: string) {.rtl, extern: "nos$1",
|
||||||
let d = newWideCString(dest)
|
let d = newWideCString(dest)
|
||||||
if moveFileW(s, d, 0'i32) == 0'i32: raiseOSError(osLastError())
|
if moveFileW(s, d, 0'i32) == 0'i32: raiseOSError(osLastError())
|
||||||
else:
|
else:
|
||||||
if moveFileA(source, dest, 0'i32) == 0'i32: raiseOSError(osLastError(),$strerror(errno))
|
if moveFileA(source, dest, 0'i32) == 0'i32: raiseOSError(osLastError())
|
||||||
else:
|
else:
|
||||||
if c_rename(source, dest) != 0'i32:
|
if c_rename(source, dest) != 0'i32:
|
||||||
raiseOSError(osLastError(), $strerror(errno))
|
raiseOSError(osLastError(), $strerror(errno))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue