minor code cleanups (#21215)

This commit is contained in:
Andreas Rumpf 2023-01-02 10:39:17 +01:00 • committed by GitHub
commit cf1b16ef8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 36 deletions

View file

@ -43,8 +43,8 @@ proc uname*(): Uname =
result.machine = charArrayToString u.machine
proc fsync*(fd: int) =
## synchronize a file's buffer cache to the storage device
if fsync(fd.cint) != 0:
## synchronize a file's buffer cache to the storage device
if fsync(fd.cint) != 0:
raise newException(OSError, $strerror(errno))
proc stat*(path: string): Stat =
@ -90,7 +90,7 @@ proc mkstemp*(prefix: string, suffix=""): (string, File) =
## Returns the filename and a file opened in r/w mode.
var tmpl = cstring(prefix & "XXXXXX" & suffix)
let fd =
if len(suffix)==0:
if len(suffix) == 0:
when declared(mkostemp):
mkostemp(tmpl, O_CLOEXEC)
else: