aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-11 18:05:38 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-11 18:07:52 +0100
commitf2454bf6ecd79f454c54b5ccd2cdcc513d232c4b (patch)
tree5f9716c9f2dacd7ac04b59e62cffc23bc4e09613
parenta32104f93b19061d85388178793040bc083151e1 (diff)
downloadchawan-f2454bf6ecd79f454c54b5ccd2cdcc513d232c4b.tar.gz
lcgi: fix error handling
POSIX does not guarantee that an error is negative.
-rw-r--r--adapter/protocol/lcgi.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/adapter/protocol/lcgi.nim b/adapter/protocol/lcgi.nim
index 0313c836..a2da4cc8 100644
--- a/adapter/protocol/lcgi.nim
+++ b/adapter/protocol/lcgi.nim
@@ -33,7 +33,7 @@ proc openSocket(os: PosixStream; host, port, resFail, connFail: string;
err = getaddrinfo(cstring(host), cstring(port), addr hints, res)
if err == 0:
break
- if err < 0:
+ if err != 0:
os.die(resFail, $gai_strerror(err))
let sock = socket(res.ai_family, res.ai_socktype, res.ai_protocol)
if cint(sock) < 0: