From 61ebb77a2919911d01ded1885db5473f59d45e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Wed, 17 Nov 2021 21:48:49 +0800 Subject: Return 0 if session terminated --- dircpsa.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dircpsa.c b/dircpsa.c index 9fbe6cb..05bf018 100644 --- a/dircpsa.c +++ b/dircpsa.c @@ -68,8 +68,13 @@ int main (int argc, char *argv[]) } if (irc_run(session)) { - printf("Could not connect or I/O error: %s\n", irc_strerror(irc_errno(session))); - return 1; + int errno = irc_errno(session); + if (errno == LIBIRC_ERR_TERMINATED) + return 0; + else { + printf("Could not connect or I/O error: %s\n", irc_strerror(errno)); + return 1; + } } return 0; -- cgit v1.2.3