fix #17749 ignore SIGPIPE signals, fix nim CI #17748 (#17752)

* fix #17749 SIGPIPE

* fix for windows
This commit is contained in:
Timothee Cour 2021-04-18 06:34:29 -07:00 • committed by GitHub
commit 42c6eec4ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 17 deletions

View file

@ -11,10 +11,13 @@ proc main() =
discard posix.raise(signal)
else:
# synchronize this list with lib/system/except.nim:registerSignalHandler()
let fatalSigs = [SIGINT, SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS,
SIGPIPE]
for s in fatalSigs:
let sigs = [SIGINT, SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS, SIGPIPE]
for s in sigs:
let (_, exitCode) = execCmdEx(quoteShellCommand [getAppFilename(), $s])
doAssert exitCode == 128 + s, "mismatched exit code for signal " & $s
if s == SIGPIPE:
# SIGPIPE should be ignored
doAssert exitCode == 0, $(exitCode, s)
else:
doAssert exitCode == 128+s, $(exitCode, s)
main()