summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Golde <nico@ngolde.de>2016-10-13 15:21:47 -0700
committerNico Golde <nico@ngolde.de>2016-10-13 15:21:47 -0700
commit714bd0cb6ae1eae57ca69b4dbe9fb5243c7a9456 (patch)
tree6c960e33b35dafc9d7f43f79159fde70b41e7cca
parentf8f3a096bc6d812b7d506d8010ca3063c3f70999 (diff)
downloadii-714bd0cb6ae1eae57ca69b4dbe9fb5243c7a9456.zip
ii-714bd0cb6ae1eae57ca69b4dbe9fb5243c7a9456.tar.gz
ii-714bd0cb6ae1eae57ca69b4dbe9fb5243c7a9456.tar.bz2
define EXIT_TIMEOUT and use that on ping timeouts. thanks Evan Gates for the idea!
-rw-r--r--ii.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ii.c b/ii.c
index 51318aa..5d57458 100644
--- a/ii.c
+++ b/ii.c
@@ -19,6 +19,8 @@
#include <time.h>
#include <unistd.h>
+#define EXIT_TIMEOUT 2
+
#ifndef PIPE_BUF /* For OS that doesn't includes PIPE_BUF in limits.h, FreeBSD? */
#define PIPE_BUF _POSIX_PIPE_BUF
#endif
@@ -446,7 +448,7 @@ static void run() {
} else if(r == 0) {
if(time(NULL) - last_response >= PING_TIMEOUT) {
print_out(NULL, "-!- ii shutting down: ping timeout");
- exit(EXIT_FAILURE);
+ exit(EXIT_TIMEOUT);
}
write(irc, ping_msg, strlen(ping_msg));
continue;