From 39ba502f8734b8f2cfda50841f5729356815c2fa Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Tue, 11 Feb 2020 01:16:30 -0800 Subject: [PATCH] fix #9634 don't crash on execCmdEx/readLine when inside gdb/lldb (#13232) * fix #9634 debugging a program using execCmdEx now works * only apply EINTR to c_gets for now This reverts commit c0f5305b5a0b46983dfd27e3d77ecbf4f8744dcc. --- lib/system/io.nim | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/system/io.nim b/lib/system/io.nim index 4bbae98b79..7b9a893bb3 100644 --- a/lib/system/io.nim +++ b/lib/system/io.nim @@ -145,6 +145,7 @@ proc strerror(errnum: cint): cstring {.importc, header: "".} when not defined(NimScript): var errno {.importc, header: "".}: cint ## error variable + EINTR {.importc: "EINTR", header: "".}: cint proc checkErr(f: File) = when not defined(NimScript): @@ -319,8 +320,20 @@ proc readLine*(f: File, line: var TaintedString): bool {.tags: [ReadIOEffect], # fgets doesn't append an \L for i in 0..