mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 07:21:19 +00:00
- fixed lock of a program when proc echo is called on Android 5.x.x (#7054)
This commit is contained in:
@@ -406,7 +406,8 @@ proc setStdIoUnbuffered() =
|
||||
|
||||
when declared(stdout):
|
||||
proc echoBinSafe(args: openArray[string]) {.compilerProc.} =
|
||||
when not defined(windows):
|
||||
# flockfile deadlocks some versions of Android 5.x.x
|
||||
when not defined(windows) and not defined(android):
|
||||
proc flockfile(f: File) {.importc, noDecl.}
|
||||
proc funlockfile(f: File) {.importc, noDecl.}
|
||||
flockfile(stdout)
|
||||
@@ -415,7 +416,7 @@ when declared(stdout):
|
||||
const linefeed = "\n" # can be 1 or more chars
|
||||
discard c_fwrite(linefeed.cstring, linefeed.len, 1, stdout)
|
||||
discard c_fflush(stdout)
|
||||
when not defined(windows):
|
||||
when not defined(windows) and not defined(android):
|
||||
funlockfile(stdout)
|
||||
|
||||
{.pop.}
|
||||
|
||||
Reference in New Issue
Block a user