From 9ad246274ba6633df87b04b46d2532cee25b047e Mon Sep 17 00:00:00 2001 From: Bleep Date: Wed, 29 Mar 2000 03:56:32 +0000 Subject: [PATCH] Author: Bleep Log message: Minor bugfix for uping. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@98 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ircd/ircd.c | 40 +++++++++++++++++++++------------------- ircd/uping.c | 2 ++ 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/ircd/ircd.c b/ircd/ircd.c index dc445cb..0f5270d 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -115,7 +115,7 @@ static void server_reboot(const char* message) Debug((DEBUG_FATAL, "Couldn't restart server \"%s\": %s", SPATH, (strerror(errno)) ? strerror(errno) : "")); - exit(-1); + exit(2); } void server_die(const char* message) @@ -123,7 +123,7 @@ void server_die(const char* message) ircd_log(L_CRIT, "Server terminating: %s", message); sendto_ops("Server terminating: %s", message); flush_connections(0); - exit(-1); + exit(2); } void server_restart(const char* message) @@ -148,16 +148,16 @@ static void write_pidfile(void) #ifdef PPATH int fd; char buff[20]; - if ((fd = open(PPATH, O_CREAT | O_WRONLY, 0600)) >= 0) { - memset(buff, 0, sizeof(buff)); - sprintf(buff, "%5d\n", (int)getpid()); - if (write(fd, buff, strlen(buff)) == -1) - Debug((DEBUG_NOTICE, "Error writing to pid file %s", PPATH)); - close(fd); + if ((fd = open(PPATH, O_CREAT | O_WRONLY, 0600)) == -1) { + Debug((DEBUG_NOTICE, "Error opening pid file \"%s\": %s", + PPATH, strerror(errno))); return; } - Debug((DEBUG_NOTICE, "Error opening pid file \"%s\": %s", - PPATH, (strerror(errno)) ? strerror(errno) : "")); + memset(buff, 0, sizeof(buff)); + sprintf(buff, "%5d\n", getpid()); + if (write(fd, buff, strlen(buff)) == -1) + Debug((DEBUG_NOTICE, "Error writing to pid file %s", PPATH)); + close(fd); #endif } @@ -172,15 +172,17 @@ static void write_pidfile(void) */ static time_t try_connections(void) { - struct ConfItem *aconf; - struct Client *cptr; - struct ConfItem **pconf; - int connecting, confrq; - time_t next = 0; - struct ConfClass *cltmp; - struct ConfItem *cconf, *con_conf = NULL; - struct Jupe *ajupe; - unsigned int con_class = 0; + struct ConfItem* aconf; + struct Client* cptr; + struct ConfItem** pconf; + int connecting; + int confrq; + time_t next = 0; + struct ConfClass* cltmp; + struct ConfItem* cconf; + strcut ConfItem* con_conf = NULL; + struct Jupe* ajupe; + unsigned int con_class = 0; connecting = FALSE; Debug((DEBUG_NOTICE, "Connection check at : %s", myctime(CurrentTime))); diff --git a/ircd/uping.c b/ircd/uping.c index fcbda29..33f46bb 100644 --- a/ircd/uping.c +++ b/ircd/uping.c @@ -196,6 +196,8 @@ void uping_send(struct UPing* pptr) char buf[BUFSIZE + 1]; assert(0 != pptr); + if (pptr->sent == pptr->count) + return; memset(buf, 0, sizeof(buf)); gettimeofday(&tv, NULL); -- 2.20.1