ソースを参照

* Cleanup some of the time_t mess

svn: 3873
Bryan Drewery 18 年 前
コミット
bc47d5d151

+ 5 - 5
src/adns.c

@@ -127,8 +127,8 @@ static void dns_on_eof(int idx);
 static const char *dns_next_server();
 static int parse_reply(char *response, size_t nbytes);
 
-time_t async_lookup_timeout = 30;
-time_t async_server_timeout = 40;
+interval_t async_lookup_timeout = 30;
+interval_t async_server_timeout = 40;
 //int resend_on_read = 0;
 
 static void 
@@ -321,7 +321,7 @@ void egg_dns_send(char *query, int len)
 	}
         if (!dns_handler.timeout_val) {
           dns_handler.timeout_val = &async_server_timeout;
-          sdprintf("SETTING TIMEOUT to %li", async_server_timeout);
+          sdprintf("SETTING TIMEOUT to %d", async_server_timeout);
           dcc[dns_idx].timeval = now;
         }
         write(dcc[dns_idx].sock, query, len);
@@ -404,7 +404,7 @@ void dns_create_timeout_timer(dns_query_t **qm, const char *query, int timeout)
 /* Perform an async dns lookup. This is host -> ip. For ip -> host, use
  * egg_dns_reverse(). We return a dns id that you can use to cancel the
  * lookup. */
-int egg_dns_lookup(const char *host, int timeout, dns_callback_t callback, void *client_data)
+int egg_dns_lookup(const char *host, interval_t timeout, dns_callback_t callback, void *client_data)
 {
 	dns_query_t *q = NULL;
 	int i, cache_id;
@@ -462,7 +462,7 @@ int egg_dns_lookup(const char *host, int timeout, dns_callback_t callback, void
 /* Perform an async dns reverse lookup. This does ip -> host. For host -> ip
  * use egg_dns_lookup(). We return a dns id that you can use to cancel the
  * lookup. */
-int egg_dns_reverse(const char *ip, int timeout, dns_callback_t callback, void *client_data)
+int egg_dns_reverse(const char *ip, interval_t timeout, dns_callback_t callback, void *client_data)
 {
 	dns_query_t *q;
 	int i, cache_id;

+ 2 - 2
src/adns.h

@@ -24,8 +24,8 @@ int egg_dns_init(void);
 //int egg_dns_shutdown(void);
 
 void egg_dns_send(char *query, int len);
-int egg_dns_lookup(const char *host, int timeout, dns_callback_t callback, void *client_data);
-int egg_dns_reverse(const char *ip, int timeout, dns_callback_t callback, void *client_data);
+int egg_dns_lookup(const char *host, interval_t timeout, dns_callback_t callback, void *client_data);
+int egg_dns_reverse(const char *ip, interval_t timeout, dns_callback_t callback, void *client_data);
 int egg_dns_cancel(int id, int issue_callback);
 void tell_dnsdebug(int);
 void dns_cache_flush();

+ 13 - 13
src/chan.h

@@ -14,7 +14,7 @@ typedef struct memstruct {
   time_t joined;
   time_t split;			/* in case they were just netsplit	*/
   time_t last;			/* for measuring idle time		*/
-  time_t delay;                  /* for delayed autoop                   */
+  interval_t delay;                  /* for delayed autoop                   */
   int hops;
   int tried_getuser;
   unsigned short flags;
@@ -151,19 +151,19 @@ struct chanset_t {
   uint32_t status;
   uint32_t ircnet_status;
   int flood_pub_thr;
-  time_t flood_pub_time;
+  interval_t flood_pub_time;
   int flood_join_thr;
-  time_t flood_join_time;
+  interval_t flood_join_time;
   int flood_deop_thr;
-  time_t flood_deop_time;
+  interval_t flood_deop_time;
   int flood_kick_thr;
-  time_t flood_kick_time;
+  interval_t flood_kick_time;
   int flood_ctcp_thr;
-  time_t flood_ctcp_time;
+  interval_t flood_ctcp_time;
   int flood_nick_thr;
-  time_t flood_nick_time;
-  time_t flood_lock_time;
-  time_t flood_mjoin_time;
+  interval_t flood_nick_time;
+  interval_t flood_lock_time;
+  interval_t flood_mjoin_time;
   int flood_mjoin_thr;
   int limitraise;
   int checklimit;
@@ -175,7 +175,7 @@ struct chanset_t {
   int mdop;
   int mop;
   int voice_non_ident;
-  int auto_delay;
+  interval_t auto_delay;
 /* Chanint template 
  *int temp;
  */
@@ -183,9 +183,9 @@ struct chanset_t {
 #ifdef REVENGE
   int revenge_mode;
 #endif
-  time_t ban_time;
-  time_t invite_time;
-  time_t exempt_time;
+  interval_t ban_time;
+  interval_t invite_time;
+  interval_t exempt_time;
 
   /* desired channel modes: */
   int mode_pls_prot;		/* modes to enforce			*/

+ 1 - 1
src/chanprog.c

@@ -369,7 +369,7 @@ void tell_settings(int idx)
   dprintf(idx, "New users get flags [%s]\n", s);
   if (conf.bot->hub && owner[0])
     dprintf(idx, "Permanent owner(s): %s\n", owner);
-  dprintf(idx, "Ignores last %li mins\n", ignore_time);
+  dprintf(idx, "Ignores last %d mins\n", ignore_time);
 }
 
 void reaffirm_owners()

+ 6 - 6
src/dcc.c

@@ -68,16 +68,16 @@ int dcc_total = 0;              /* size of dcc table
 int dccn = 0;			/* actual number of dcc entries */
 int uplink_idx = -1;
 
-static time_t password_timeout = 40;       /* Time to wait for a password from a user */
-static time_t auth_timeout = 80;
-static time_t bot_timeout = 15;    /* Bot timeout value                       */
-static time_t identtimeout = 15;   /* Timeout value for ident lookups         */
-static time_t dupwait_timeout = 5; /* Timeout for rejecting duplicate entries */
+static interval_t password_timeout = 40;       /* Time to wait for a password from a user */
+static interval_t auth_timeout = 80;
+static interval_t bot_timeout = 15;    /* Bot timeout value                       */
+static interval_t identtimeout = 15;   /* Timeout value for ident lookups         */
+static interval_t dupwait_timeout = 5; /* Timeout for rejecting duplicate entries */
 
 bool protect_telnet = 0;  /* Even bother with ident lookups :)       */
 static int flood_telnet_thr = 10;       /* Number of telnet connections to be
                                          * considered a flood                      */
-static time_t flood_telnet_time = 5;       /* In how many seconds?                    */
+static interval_t flood_telnet_time = 5;       /* In how many seconds?                    */
 
 static void dcc_telnet_got_ident(int, char *);
 static void dcc_telnet_pass(int, int);

+ 1 - 1
src/dcc.h

@@ -17,7 +17,7 @@ struct dcc_table {
   int flags;
   void (*eof) (int);
   void (*activity) (int, char *, int);
-  time_t *timeout_val;
+  interval_t *timeout_val;
   void (*timeout) (int);
   void (*display) (int, char *);
   void (*kill) (int, void *);

+ 1 - 1
src/dccutil.c

@@ -54,7 +54,7 @@
 
 static struct portmap *root = NULL;
 
-time_t connect_timeout = 40;    /* How long to wait before a telnet connection times out */
+interval_t connect_timeout = 40;    /* How long to wait before a telnet connection times out */
 int max_dcc = 200;
 
 static int dcc_flood_thr = 3;

+ 1 - 1
src/dccutil.h

@@ -62,6 +62,6 @@ void set_cmd_pass(char *, int);
 void cmdpass_free(struct cmd_pass *);
 
 extern int		max_dcc;
-extern time_t		connect_timeout;
+extern interval_t		connect_timeout;
 
 #endif /* !_DCCUTIL_H */

+ 4 - 4
src/main.c

@@ -456,7 +456,7 @@ static void dtx_arg(int& argc, char *argv[])
 }
 
 /* Timer info */
-static time_t		lastmin = 99;
+static int		lastmin = 99;
 static struct tm	nowtm;
 
 void core_10secondly()
@@ -543,19 +543,19 @@ static void core_secondly()
 
   egg_memcpy(&nowtm, gmtime(&now), sizeof(struct tm));
   if (nowtm.tm_min != lastmin) {
-    time_t i = 0;
+    int i = 0;
 
     /* Once a minute */
     lastmin = (lastmin + 1) % 60;
     /* In case for some reason more than 1 min has passed: */
     while (nowtm.tm_min != lastmin) {
       /* Timer drift, dammit */
-      debug2("timer: drift (lastmin=%lu, now=%d)", lastmin, nowtm.tm_min);
+      debug2("timer: drift (lastmin=%d, now=%d)", lastmin, nowtm.tm_min);
       ++i;
       lastmin = (lastmin + 1) % 60;
     }
     if (i > 1)
-      putlog(LOG_MISC, "*", "(!) timer drift -- spun %lu minutes", i);
+      putlog(LOG_MISC, "*", "(!) timer drift -- spun %d minutes", i);
     miltime = (nowtm.tm_hour * 100) + (nowtm.tm_min);
     if (conf.bot->hub && ((int) (nowtm.tm_min / 5) * 5) == (nowtm.tm_min)) {	/* 5 min */
 /* 	flushlogs(); */

+ 13 - 13
src/mod/channels.mod/channels.c

@@ -54,9 +54,9 @@
 static bool 			use_info = 1;
 static char 			glob_chanmode[64] = "nt";		/* Default chanmode (drummer,990731) */
 //static int 			global_revenge_mode = 3;
-static time_t 			global_ban_time;
-static time_t			global_exempt_time;
-static time_t 			global_invite_time;
+static interval_t 			global_ban_time;
+static interval_t			global_exempt_time;
+static interval_t 			global_invite_time;
 
 
 /* Global channel settings (drummer/dw) */
@@ -65,17 +65,17 @@ static char *lastdeletedmask = NULL;
 
 /* Global flood settings */
 static int 			gfld_chan_thr;
-static time_t 			gfld_chan_time;
+static interval_t 		gfld_chan_time;
 static int 			gfld_deop_thr = 8;
-static time_t 			gfld_deop_time = 10;
+static interval_t 		gfld_deop_time = 10;
 static int 			gfld_kick_thr;
-static time_t 			gfld_kick_time;
+static interval_t 		gfld_kick_time;
 static int 			gfld_join_thr;
-static time_t 			gfld_join_time;
+static interval_t 		gfld_join_time;
 static int 			gfld_ctcp_thr = 5;
-static time_t 			gfld_ctcp_time = 30;
+static interval_t 		gfld_ctcp_time = 30;
 static int			gfld_nick_thr;
-static time_t 			gfld_nick_time;
+static interval_t		gfld_nick_time;
 
 static int 			killed_bots = 0;
 
@@ -285,7 +285,7 @@ static void got_cycle(char *botnick, char *code, char *par)
   if (!(chan = findchan_by_dname(chname)))
    return;
 
-  time_t delay = 10;
+  interval_t delay = 10;
 
   if (par[0])
     delay = atoi(newsplit(&par));
@@ -907,9 +907,9 @@ void channels_report(int idx, int details)
           dprintf(idx, "      revenge-mode %d\n",
                   chan->revenge_mode);
 */
-       dprintf(idx, "    Bans last %lu mins.\n", chan->ban_time);
-       dprintf(idx, "    Exemptions last %lu mins.\n", chan->exempt_time);
-       dprintf(idx, "    Invitations last %lu mins.\n", chan->invite_time);
+       dprintf(idx, "    Bans last %d mins.\n", chan->ban_time);
+       dprintf(idx, "    Exemptions last %d mins.\n", chan->exempt_time);
+       dprintf(idx, "    Invitations last %d mins.\n", chan->invite_time);
       }
     }
   }

+ 1 - 1
src/mod/channels.mod/cmdschan.c

@@ -1271,7 +1271,7 @@ static void cmd_chaninfo(int idx, char *par)
 	    chan->flood_join_thr, chan->flood_kick_thr,
 	    chan->flood_deop_thr, chan->flood_nick_thr,
             chan->flood_mjoin_thr);
-    dprintf(idx, "  time  :          %3lu  %3lu  %3lu  %3lu  %3lu  %3lu  %3lu\n",
+    dprintf(idx, "  time  :          %3u  %3u  %3u  %3u  %3u  %3u  %3u\n",
 	    chan->flood_pub_time, chan->flood_ctcp_time,
 	    chan->flood_join_time, chan->flood_kick_time,
 	    chan->flood_deop_time, chan->flood_nick_time,

+ 2 - 2
src/mod/channels.mod/tclchan.c

@@ -668,7 +668,7 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
     else if (!cmd && !strncmp(item[i], "need-", 5))   ;
     else if (!strncmp(item[i], "flood-", 6)) {
       int *pthr = NULL;
-      time_t *ptime = NULL;
+      interval_t *ptime = NULL;
       char *p = NULL;
 
       if (!strcmp(item[i] + 6, "*")) {
@@ -681,7 +681,7 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
         p = strchr(item[i], ':');
 
         int thr = 0;
-        time_t time = 0;
+        interval_t time = 0;
 
         if (p) {
           *p++ = 0;

+ 9 - 9
src/mod/channels.mod/userchan.c

@@ -748,11 +748,11 @@ bool write_chans(FILE *f, int idx)
     if (lfprintf(f, "\
 + channel add %s { chanmode { %s } addedby %s addedts %lu \
 bad-cookie %d manop %d mdop %d mop %d limit %d \
-flood-chan %d:%lu flood-ctcp %d:%lu flood-join %d:%lu \
-flood-kick %d:%lu flood-deop %d:%lu flood-nick %d:%lu flood-mjoin %d:%lu \
-closed-ban %d closed-invite %d closed-private %d ban-time %lu \
-exempt-time %lu invite-time %lu voice-non-ident %d auto-delay %d \
-flood-exempt %d flood-lock-time %lu \
+flood-chan %d:%d flood-ctcp %d:%d flood-join %d:%d \
+flood-kick %d:%d flood-deop %d:%d flood-nick %d:%d flood-mjoin %d:%d \
+closed-ban %d closed-invite %d closed-private %d ban-time %d \
+exempt-time %d invite-time %d voice-non-ident %d auto-delay %d \
+flood-exempt %d flood-lock-time %d \
 %cmeankicks %cenforcebans %cdynamicbans %cuserbans %cbitch \
 %cprivate %ccycle %cinactive %cdynamicexempts %cuserexempts \
 %cdynamicinvites %cuserinvites %cnodesynch %cclosed %cvoice \
@@ -852,10 +852,10 @@ bool write_chans_compat(FILE *f, int idx)
     if (lfprintf(f, "\
 + channel add %s { chanmode { %s } addedby %s addedts %lu \
 bad-cookie %d manop %d mdop %d mop %d limit %d \
-flood-chan %d:%lu flood-ctcp %d:%lu flood-join %d:%lu \
-flood-kick %d:%lu flood-deop %d:%lu flood-nick %d:%lu \
-closed-ban %d closed-invite %d closed-private %d ban-time %lu \
-exempt-time %lu invite-time %lu voice-non-ident %d auto-delay %d \
+flood-chan %d:%d flood-ctcp %d:%d flood-join %d:%d \
+flood-kick %d:%d flood-deop %d:%d flood-nick %d:%d \
+closed-ban %d closed-invite %d closed-private %d ban-time %d \
+exempt-time %d invite-time %d voice-non-ident %d auto-delay %d \
 %cenforcebans %cdynamicbans %cuserbans %cbitch \
 %cprivate %ccycle %cinactive %cdynamicexempts %cuserexempts \
 %cdynamicinvites %cuserinvites %cnodesynch %cclosed %cvoice \

+ 1 - 1
src/mod/ctcp.mod/ctcp.c

@@ -48,7 +48,7 @@
 #define AVGHERETIME             5
 time_t cloak_awaytime = 0;
 time_t cloak_heretime = 0;
-time_t listen_time = 0;
+interval_t listen_time = 0;
 char cloak_bxver[10] = "";
 char cloak_os[20] = "";
 char cloak_osver[100] = "";

+ 3 - 3
src/mod/irc.mod/irc.c

@@ -175,7 +175,7 @@ void detected_drone_flood(struct chanset_t* chan, memberlist* m) {
     howlong.usec = 0;
     timer_create_complex(&howlong, "unlock", (Function) unlock_chan, (void *) chan, 0);
 
-    putlog(LOG_MISC, "*", "Flood detected in %s! Locking for %li seconds.", chan->dname, chan->flood_lock_time);
+    putlog(LOG_MISC, "*", "Flood detected in %s! Locking for %d seconds.", chan->dname, chan->flood_lock_time);
   }
 }
 
@@ -774,7 +774,7 @@ request_op(struct chanset_t *chan)
     i++;
   }
   if ((5 - my_exp) >= op_requests.count) {
-    putlog(LOG_GETIN, "*", "Delaying opreq for %s - Maximum of %d:%li reached", chan->dname, op_requests.count,
+    putlog(LOG_GETIN, "*", "Delaying opreq for %s - Maximum of %d:%d reached", chan->dname, op_requests.count,
            op_requests.time);
     chan->channel.no_op = now + op_requests.time + 1;
     return;
@@ -805,7 +805,7 @@ request_op(struct chanset_t *chan)
   if (!i) {
     if (channel_active(chan) && !channel_pending(chan)) {
       chan->channel.no_op = now + op_requests.time;
-      putlog(LOG_GETIN, "*", "No one to ask for ops on %s - Delaying requests for %lu seconds.", chan->dname, op_requests.time);
+      putlog(LOG_GETIN, "*", "No one to ask for ops on %s - Delaying requests for %d seconds.", chan->dname, op_requests.time);
     }
     return;
   }

+ 1 - 1
src/mod/irc.mod/irc.h

@@ -75,7 +75,7 @@ static void flush_mode(struct chanset_t *, int);
 
 static void detect_offense(memberlist*, struct chanset_t *, char *);
 /* static int target_priority(struct chanset_t *, memberlist *, int); */
-static bool do_op(char *, struct chanset_t *, time_t, bool);
+static bool do_op(char *, struct chanset_t *, bool, bool);
 static void request_op(struct chanset_t *);
 static void request_in(struct chanset_t *);
 static void my_setkey(struct chanset_t *, char *);

+ 1 - 1
src/mod/irc.mod/mode.c

@@ -91,7 +91,7 @@ static size_t egg_strcatn(char *dst, const char *src, size_t max)
 }
 
 static bool
-do_op(char *nick, struct chanset_t *chan, time_t delay, bool force)
+do_op(char *nick, struct chanset_t *chan, bool delay, bool force)
 {
   memberlist *m = ismember(chan, nick);
 

+ 4 - 5
src/mod/server.mod/server.c

@@ -72,14 +72,13 @@ static bool keepnick = 1;		/* keep trying to regain my intended
 static bool nick_juped = 0;	/* True if origbotname is juped(RPL437) (dw) */
 static bool jnick_juped = 0;    /* True if jupenick is juped */
 bool tried_jupenick = 0;
-static time_t waiting_for_awake;	/* set when i unidle myself, cleared when
-				   i get the response */
+static bool waiting_for_awake;	/* set when i unidle myself, cleared when I get the response */
 time_t server_online;	/* server connection time */
 char botrealname[121] = "A deranged product of evil coders.";	/* realname of bot */
-static time_t server_timeout = 15;	/* server timeout for connecting */
+static interval_t server_timeout = 15;	/* server timeout for connecting */
 struct server_list *serverlist = NULL;	/* old-style queue, still used by
 					   server list */
-time_t cycle_time;			/* cycle time till next server connect */
+interval_t cycle_time;			/* cycle time till next server connect */
 port_t default_port = 6667;		/* default IRC port */
 bool trigger_on_ignore;	/* trigger bindings if user is ignored ? */
 int answer_ctcp = 1;		/* answer how many stacked ctcp's ? */
@@ -1027,7 +1026,7 @@ void server_report(int idx, int details)
     dprintf(idx, "    Help queue is at %d%%, %d msgs\n",
            (int) ((float) (hq.tot * 100.0) / (float) maxqmsg), (int) hq.tot);
   if (details) {
-    dprintf(idx, "    Flood is: %d msg/%lus, %d ctcp/%lus\n",
+    dprintf(idx, "    Flood is: %d msg/%ds, %d ctcp/%ds\n",
 	    flood_msg.count, flood_msg.time, flood_ctcp.count, flood_ctcp.time);
   }
 }

+ 2 - 1
src/mod/server.mod/server.h

@@ -49,7 +49,8 @@ extern bool		trigger_on_ignore, floodless, tried_jupenick;
 extern int 		servidx, ctcp_mode, answer_ctcp, serv, curserv, default_alines;
 extern unsigned int     rolls;
 extern port_t		default_port, newserverport, curservport;
-extern time_t		server_online, cycle_time;
+extern time_t		server_online;
+extern interval_t	cycle_time;
 extern char		cursrvname[], botrealname[121], botuserhost[], ctcp_reply[1024],
 			newserver[], newserverpass[], curnetwork[], botuserip[], altnick_char;
 extern struct server_list *serverlist;

+ 2 - 2
src/mod/server.mod/servmsg.c

@@ -350,7 +350,7 @@ static time_t lastmsgtime[FLOOD_GLOBAL_MAX];
 static int dronemsgs;
 static time_t dronemsgtime;
 static bool set_pls_g;
-static time_t flood_g_time = 60;
+static interval_t flood_g_time = 60;
 
 rate_t flood_g = { 6, 2 };
 
@@ -416,7 +416,7 @@ static bool detect_flood(char *floodnick, char *floodhost, char *from, int which
     howlong.sec = flood_g_time;
     howlong.usec = 0;
     timer_create(&howlong, "Unset umode +g", (Function) unset_g);
-    putlog(LOG_MISC, "*", "Drone flood detected! Setting +g for %li seconds.", flood_g_time);
+    putlog(LOG_MISC, "*", "Drone flood detected! Setting +g for %d seconds.", flood_g_time);
     return 1;	//ignore the current msg
   }
 

+ 1 - 1
src/mod/transfer.mod/transfer.c

@@ -53,7 +53,7 @@
 
 extern int		bupdating;
 
-static time_t wait_dcc_xfer = 40;	/* Timeout time on DCC xfers */
+static interval_t wait_dcc_xfer = 40;	/* Timeout time on DCC xfers */
 static int dcc_limit = 4;	/* Maximum number of simultaneous file
 				   downloads allowed */
 static unsigned int dcc_block = 0;	/* Size of one dcc block */

+ 0 - 1
src/net.c

@@ -72,7 +72,6 @@ union sockaddr_union cached_myip6_so;
 bool	cached_ip = 0;		/* Set to 1 after cache_my_ip is called */
 bool    identd_hack = 0;	/* identd_open() won't work on most servers, dont even bother warning. */
 char	botuser[21] = ""; 	/* Username of the user running the bot    */
-int     resolve_timeout = 10;   /* hostname/address lookup timeout */
 int	socks_total = 0;	/* total number of sockets */
 sock_list *socklist = NULL;	/* Enough to be safe			    */
 int	MAXSOCKS = 0;

+ 1 - 1
src/net.h

@@ -160,7 +160,7 @@ extern unsigned long			notalloc;
 #endif /* USE_IPV6 */
 
 extern char				firewall[], botuser[];
-extern int				resolve_timeout, MAXSOCKS, socks_total;
+extern int				MAXSOCKS, socks_total;
 extern bool				identd_hack, cached_ip;
 extern port_t				firewallport;
 extern jmp_buf				alarmret;

+ 2 - 2
src/set.c

@@ -213,7 +213,7 @@ char *var_sanitize(variable_t *var, const char *data)
 
     /* No limit enforcing yet */
     dataout = (char*) my_calloc(1, 21);
-    egg_snprintf(dataout, 21, "%u:%li", rate.count, rate.time);
+    simple_snprintf(dataout, 21, "%d:%d", rate.count, rate.time);
   } else if ((var->flags & VAR_SERVERS)) {
     dataout = data ? strdup(data) : NULL;
   }
@@ -387,7 +387,7 @@ const char *var_string(variable_t *var)
     /* only bother setting if we don't have 0:0 */
     if ((*(rate_t *) (var->mem)).count && (*(rate_t *) (var->mem)).time) {
       data = (char *) my_calloc(1, 21);
-      egg_snprintf(data, 21, "%d:%li", (*(rate_t *) (var->mem)).count, (*(rate_t *) (var->mem)).time);
+      simple_snprintf(data, 21, "%d:%d", (*(rate_t *) (var->mem)).count, (*(rate_t *) (var->mem)).time);
     }
   } else if (var->flags & VAR_SERVERS) {
     /* only bother setting/checking if we have 'serverlist' alloc'd */

+ 1 - 1
src/set.h

@@ -62,7 +62,7 @@ typedef struct variable_b {
 
 typedef struct rate_b {
  int count;
- time_t time;
+ interval_t time;
 } rate_t;
 
 extern char		auth_key[], auth_prefix[2], motd[], *def_chanset, alias[],

+ 5 - 1
src/socket.c

@@ -30,6 +30,10 @@
 #include <sys/socket.h>
 #include <arpa/inet.h>
 
+#ifdef no
+static interval_t     resolve_timeout = 10;   /* hostname/address lookup timeout */
+#endif
+
 int is_dotted_ip(const char *ip)
 {
         char buf[512];
@@ -73,7 +77,7 @@ static int egg_connect_timeout(void *client_data)
         return(0);
 }
 
-static connect_info_t *attach(int idx, const char *host, int port, int timeout)
+static connect_info_t *attach(int idx, const char *host, int port, interval_t timeout)
 {
         connect_info_t *connect_info = (connect_info_t *) my_calloc(1, sizeof(*connect_info));
 

+ 3 - 0
src/types.h

@@ -39,6 +39,9 @@ typedef u_32bit_t 		dword;
 /* port */
 typedef in_port_t		port_t;
 
+// Signed so that it can play nice with time_t
+typedef int			interval_t;
+
 typedef struct {
   int family;
   union {

+ 1 - 1
src/users.c

@@ -56,7 +56,7 @@
 #include "misc_file.h"
 
 char userfile[121] = "";	/* where the user records are stored */
-time_t ignore_time = 10;		/* how many minutes will ignores last? */
+interval_t ignore_time = 10;		/* how many minutes will ignores last? */
 bool	dont_restructure = 0;		/* set when we botlink() to a hub with +U, only stops bot from restructuring */
 
 /* is this nick!user@host being ignored? */

+ 1 - 1
src/users.h

@@ -176,7 +176,7 @@ void link_pref_val(struct userrec *u, char *lval);
 void check_stale_dcc_users();
 
 extern char			userfile[];
-extern time_t			ignore_time;
+extern interval_t			ignore_time;
 extern bool			dont_restructure;
 
 #endif				/* _EGG_USERS_H */