[hackers] [ii] define EXIT_TIMEOUT and use that on ping timeouts. thanks Evan Gates for the idea! || Nico Golde
commit 714bd0cb6ae1eae57ca69b4dbe9fb5243c7a9456
Author: Nico Golde <nico_AT_ngolde.de>
AuthorDate: Thu Oct 13 15:21:47 2016 -0700
Commit: Nico Golde <nico_AT_ngolde.de>
CommitDate: Thu Oct 13 15:21:47 2016 -0700
define EXIT_TIMEOUT and use that on ping timeouts. thanks Evan Gates for the idea!
diff --git a/ii.c b/ii.c
index 51318aa..5d57458 100644
--- a/ii.c
+++ b/ii.c
_AT_@ -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
_AT_@ -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;
Received on Fri Oct 14 2016 - 00:21:56 CEST
This archive was generated by hypermail 2.3.0
: Fri Oct 14 2016 - 00:24:17 CEST