fix #17888: remove undefined behavior for posix.open; fix tempfiles.createTempFile (#17889)

* fix #17888: remove undefined behavior for posix.open; fix tempfiles.createTempFile

* fix for tests/async/tasyncfile.nim

* hide mode for now

* add notice regarding stability
This commit is contained in:
Timothee Cour 2021-04-29 04:42:56 -07:00 • committed by GitHub
commit e4db733d80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 4 deletions

View file

@ -1503,6 +1503,7 @@ when false:
of fmReadWrite: flags = O_RDWR or int(O_CREAT)
of fmReadWriteExisting: flags = O_RDWR
of fmAppend: flags = O_WRONLY or int(O_CREAT) or O_APPEND
static: doAssert false # handle bug #17888
var handle = open(filename, flags)
if handle < 0: raise newEOS("posix.open() call failed")
result = newFileHandleStream(handle)