Thread: [IRC-Dev CVS] Module ircdh: Change commited ircdh/ircd IPcheck.c,1.2,1.3 Makefile.in,1.4,1.5 hash.c,
Brought to you by:
zolty
Update of /cvsroot/irc-dev/ircdh/ircd In directory usw-pr-cvs1:/tmp/cvs-serv1402/ircdh/ircd Modified Files: IPcheck.c Makefile.in hash.c ircd.c ircd_log.c ircd_signal.c list.c map.c opercmds.c os_bsd.c os_generic.c os_linux.c os_solaris.c querycmds.c s_auth.c s_bsd.c s_conf.c s_debug.c s_misc.c s_serv.c s_user.c send.c support.c Log Message: Make indent Index: IPcheck.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/IPcheck.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- IPcheck.c 15 Aug 2002 20:55:23 -0000 1.2 +++ IPcheck.c 18 Aug 2002 22:59:22 -0000 1.3 @@ -179,7 +179,8 @@ /* Make ever 10000 disconnects an estimation of the average vector length */ count = 10000; average_length = - (UserStats.clients + UserStats.unknowns + UserStats.local_servers) / HASHTABSIZE; + (UserStats.clients + UserStats.unknowns + + UserStats.local_servers) / HASHTABSIZE; } /* Now check the new element (last) that was moved to this position */ continue; @@ -213,7 +214,8 @@ /* Make ever 10000 disconnects an estimation of the average vector length */ count = 10000; average_length = - (UserStats.clients + UserStats.unknowns + UserStats.local_servers) / HASHTABSIZE; + (UserStats.clients + UserStats.unknowns + + UserStats.local_servers) / HASHTABSIZE; } } else if (CONNECTED_SINCE(curr) > 120U && HAS_TARGETS(curr)) @@ -341,7 +343,8 @@ if (clones) cptr->nexttarget = CurrentTime - (TARGET_DELAY * (STARTTARGETS - 1)); else - cptr->nexttarget = CurrentTime - (TARGET_DELAY * (FREE_TARGETS(entry) - 1)); + cptr->nexttarget = + CurrentTime - (TARGET_DELAY * (FREE_TARGETS(entry) - 1)); #else cptr->nexttarget = CurrentTime - (TARGET_DELAY * (FREE_TARGETS(entry) - 1)); #endif @@ -596,7 +599,7 @@ if ((entry = IPregistry_find(hash, cptr->ip))) { tiempo = (CurrentTime & 0xffffff) - entry->ultimo_chequeo; /* 24 bits. Debe coincidir con el taman~o de la estructura - */ + */ #if defined(BDD) && defined(BDD_CLONES) if (IPbusca_clones_cptr(cptr) != -1) /* HIT! */ Index: Makefile.in =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/Makefile.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.in 18 Aug 2002 22:49:41 -0000 1.4 +++ Makefile.in 18 Aug 2002 22:59:22 -0000 1.5 @@ -328,11 +328,11 @@ ../include/s_bsd.h ../include/s_conf.h ../include/s_misc.h \ ../include/send.h ../include/sys.h ../include/userload.h \ ../include/version.h ../include/s_serv.h ../include/bsd.h -ircd_osdep.o: ircd_osdep.c ../include/ircd_osdep.h ircd_log.o: ircd_log.c ../include/ircd_log.h ../include/struct.h \ ../include/whowas.h ../include/h.h ../include/s_debug.h \ ../config/config.h ../config/setup.h ../include/ircd_defs.h \ ../include/dbuf.h ../include/s_serv.h +ircd_osdep.o: ircd_osdep.c ../include/ircd_osdep.h ircd_signal.o: ircd_signal.c ../include/ircd_signal.h ../include/ircd.h \ ../config/config.h ../config/setup.h ../include/struct.h \ ../include/whowas.h ../include/h.h ../include/s_debug.h \ Index: hash.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/hash.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- hash.c 15 Aug 2002 20:55:24 -0000 1.2 +++ hash.c 18 Aug 2002 22:59:22 -0000 1.3 @@ -190,7 +190,7 @@ { channelTable[l] = (struct Channel *)NULL; clientTable[l] = (struct Client *)NULL; - watchTable[l] = (struct Watch *) NULL; + watchTable[l] = (struct Watch *)NULL; }; /* Here is to what we "map" a char before working on it */ @@ -629,4 +629,3 @@ /* return wptr; */ } - Index: ircd.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/ircd.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ircd.c 18 Aug 2002 22:49:42 -0000 1.3 +++ ircd.c 18 Aug 2002 22:59:22 -0000 1.4 @@ -28,7 +28,7 @@ #include "crule.h" #include "hash.h" #if 0 -#include "ircd_alloc.h" /* set_nomem_handler */ +#include "ircd_alloc.h" /* set_nomem_handler */ #endif #include "ircd_defs.h" #include "ircd_log.h" @@ -81,12 +81,12 @@ extern void init_counters(void); -struct Client me; /* That's me */ +struct Client me; /* That's me */ struct Client *GlobalClientList = &me; /* Pointer to beginning of Client list */ -time_t TSoffset = 0; /* Offset of timestamps to system clock */ -int GlobalRehashFlag = 0; /* do a rehash if set */ -int GlobalRestartFlag = 0; /* do a restart if set */ -time_t CurrentTime; /* Updated every time we leave select() */ +time_t TSoffset = 0; /* Offset of timestamps to system clock */ +int GlobalRehashFlag = 0; /* do a rehash if set */ +int GlobalRestartFlag = 0; /* do a restart if set */ +time_t CurrentTime; /* Updated every time we leave select() */ char **myargv; char *configfile = CPATH; /* Server configuration file */ @@ -102,7 +102,7 @@ int pid_fd = -1; /* We'll get an advisory lock in check_pid */ -unsigned short int portnum = 0; /* Server port number, listening this OBSOLETO */ +unsigned short int portnum = 0; /* Server port number, listening this OBSOLETO */ #ifdef PROFIL extern etext(void); #endif @@ -136,7 +136,7 @@ Debug((DEBUG_FATAL, "Couldn't restart server \"%s\": %s", - SPATH, (strerror(errno)) ? strerror(errno) : "")); + SPATH, (strerror(errno)) ? strerror(errno) : "")); exit(-1); } @@ -153,7 +153,8 @@ static int restarting = 0; ircd_log(L_WARNING, "Restarting Server: %s", message); - if (restarting == 0) { + if (restarting == 0) + { restarting = 1; server_reboot(message); } @@ -164,14 +165,15 @@ { Debug((DEBUG_FATAL, "Out of memory: restarting server...")); server_restart("Out of Memory"); -} +} #endif static void write_pidfile(void) { #ifdef PPATH char buff[20]; - if (pid_fd >= 0) { + if (pid_fd >= 0) + { memset(buff, 0, sizeof(buff)); sprintf(buff, "%5d\n", (int)getpid()); if (write(pid_fd, buff, strlen(buff)) == -1) @@ -179,7 +181,7 @@ return; } Debug((DEBUG_NOTICE, "Error opening pid file \"%s\": %s", - PPATH, (strerror(errno)) ? strerror(errno) : "")); + PPATH, (strerror(errno)) ? strerror(errno) : "")); #endif } @@ -323,7 +325,8 @@ #endif ping = IsRegistered(cptr) ? get_client_ping(cptr) : CONNECTTIMEOUT; Debug((DEBUG_DEBUG, "c(%s)=%d p %d r %d a %d", - cptr->name, cptr->status, ping, rflag, (int)(CurrentTime - cptr->lasttime))); + cptr->name, cptr->status, ping, rflag, + (int)(CurrentTime - cptr->lasttime))); /* * Ok, so goto's are ugly and can be avoided here but this code * is already indented enough so I think its justified. -avalon @@ -438,7 +441,7 @@ else sendto_one(cptr, "%s PING :%s", NumServ(&me), me.name); #else - sendto_one(cptr, "%s " TOK_PING " :%s", NumServ(&me), me.name); + sendto_one(cptr, "%s " TOK_PING " :%s", NumServ(&me), me.name); #endif } } @@ -744,7 +747,8 @@ portnum = PORTNUM; me.port = portnum; init_sys(); - if (check_pid()) { + if (check_pid()) + { Debug((DEBUG_FATAL, "Failed to acquire PID file lock after fork")); exit(2); } Index: ircd_log.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/ircd_log.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ircd_log.c 18 Aug 2002 22:49:42 -0000 1.1 +++ ircd_log.c 18 Aug 2002 22:59:22 -0000 1.2 @@ -39,7 +39,7 @@ #include <syslog.h> #include <unistd.h> -#define LOG_BUFSIZE 2048 +#define LOG_BUFSIZE 2048 static int logLevel = L_INFO; @@ -103,34 +103,33 @@ int get_log_level(void) { - return(logLevel); + return (logLevel); } /* * ircd_log_kill - log information about a kill */ void ircd_log_kill(const struct Client *victim, const struct Client *killer, - const char *inpath, const char *path) + const char *inpath, const char *path) { - if (MyUser(victim)) { + if (MyUser(victim)) + { /* * get more infos when your local clients are killed -- _dl */ if (IsServer(killer)) ircd_log(L_TRACE, - "A local client %s!%s@%s KILLED from %s [%s] Path: %s!%s)", - victim->name, victim->user->username, victim->user->host, - killer->name, killer->name, inpath, path); + "A local client %s!%s@%s KILLED from %s [%s] Path: %s!%s)", + victim->name, victim->user->username, victim->user->host, + killer->name, killer->name, inpath, path); else ircd_log(L_TRACE, - "A local client %s!%s@%s KILLED by %s [%s!%s@%s] (%s!%s)", - victim->name, victim->user->username, victim->user->host, - killer->name, killer->name, killer->user->username, killer->user->host, - inpath, path); + "A local client %s!%s@%s KILLED by %s [%s!%s@%s] (%s!%s)", + victim->name, victim->user->username, victim->user->host, + killer->name, killer->name, killer->user->username, + killer->user->host, inpath, path); } else ircd_log(L_TRACE, "KILL From %s For %s Path %s!%s", - killer->name, victim->name, inpath, path); + killer->name, victim->name, inpath, path); } - - Index: ircd_signal.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/ircd_signal.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ircd_signal.c 18 Aug 2002 22:49:42 -0000 1.1 +++ ircd_signal.c 18 Aug 2002 22:59:22 -0000 1.2 @@ -99,5 +99,3 @@ siginterrupt(SIGALRM, 1); #endif } - - Index: list.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/list.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- list.c 18 Aug 2002 22:49:42 -0000 1.3 +++ list.c 18 Aug 2002 22:59:22 -0000 1.4 @@ -43,8 +43,7 @@ #ifdef DEBUGMODE static struct liststats { int inuse; -} cloc, crem, users, servs, links, classs, aconfs, watchs - ; +} cloc, crem, users, servs, links, classs, aconfs, watchs; #endif void outofmemory(); @@ -515,7 +514,7 @@ if (BadPtr(nick)) return NULL; - wptr = (struct Watch *) RunMalloc(sizeof(struct Watch)); + wptr = (struct Watch *)RunMalloc(sizeof(struct Watch)); if (!wptr) outofmemory(); memset(wptr, 0, sizeof(struct Watch)); Index: map.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/map.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- map.c 15 Aug 2002 20:55:24 -0000 1.2 +++ map.c 18 Aug 2002 22:59:22 -0000 1.3 @@ -66,7 +66,8 @@ sprintf(buf, "%s:%d", NumServ(server), base64toint(NumServ(server))); clientes_float = (int)((1000.0 * (server == - &me ? UserStats.local_clients : server->serv->clients)) / clientes + 0.5); + &me ? UserStats.local_clients : server->serv->clients)) / clientes + + 0.5); sendto_one(cptr, rpl_str(RPL_MAP), me.name, cptr->name, prompt, ((IsBurstOrBurstAck(server)) ? "*" : ""), server->name, buf, lag, (server == &me) ? UserStats.local_clients : server->serv->clients, Index: opercmds.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/opercmds.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- opercmds.c 18 Aug 2002 22:49:42 -0000 1.5 +++ opercmds.c 18 Aug 2002 22:59:22 -0000 1.6 @@ -1521,13 +1521,15 @@ link_u[i], acptr->name, acptr->serv->by, acptr->serv->user->username, acptr->serv->user->host, - CurrentTime - acptr->lasttime, CurrentTime - acptr->serv->timestamp); + CurrentTime - acptr->lasttime, + CurrentTime - acptr->serv->timestamp); else sendto_one(sptr, rpl_str(RPL_TRACESERVER), me.name, parv[0], conClass, link_s[i], link_u[i], acptr->name, *(acptr->serv->by) ? acptr->serv->by : "*", "*", me.name, - CurrentTime - acptr->lasttime, CurrentTime - acptr->serv->timestamp); + CurrentTime - acptr->lasttime, + CurrentTime - acptr->serv->timestamp); cnt++; break; case STAT_LOG: Index: os_bsd.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/os_bsd.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- os_bsd.c 18 Aug 2002 22:49:42 -0000 1.1 +++ os_bsd.c 18 Aug 2002 22:59:22 -0000 1.2 @@ -76,30 +76,30 @@ secs = 1; sprintf(buf, "CPU Secs %ld:%ld User %ld:%ld System %ld:%ld", - secs / 60, secs % 60, - rus.ru_utime.tv_sec / 60, rus.ru_utime.tv_sec % 60, - rus.ru_stime.tv_sec / 60, rus.ru_stime.tv_sec % 60); - (*enumerator)(cptr, buf); + secs / 60, secs % 60, + rus.ru_utime.tv_sec / 60, rus.ru_utime.tv_sec % 60, + rus.ru_stime.tv_sec / 60, rus.ru_stime.tv_sec % 60); + (*enumerator) (cptr, buf); sprintf(buf, "RSS %ld ShMem %ld Data %ld Stack %ld", - rus.ru_maxrss, - rus.ru_ixrss / (uptime * hzz), rus.ru_idrss / (uptime * hzz), - rus.ru_isrss / (uptime * hzz)); - (*enumerator)(cptr, buf); + rus.ru_maxrss, + rus.ru_ixrss / (uptime * hzz), rus.ru_idrss / (uptime * hzz), + rus.ru_isrss / (uptime * hzz)); + (*enumerator) (cptr, buf); sprintf(buf, "Swaps %ld Reclaims %ld Faults %ld", - rus.ru_nswap, rus.ru_minflt, rus.ru_majflt); - (*enumerator)(cptr, buf); + rus.ru_nswap, rus.ru_minflt, rus.ru_majflt); + (*enumerator) (cptr, buf); sprintf(buf, "Block in %ld out %ld", rus.ru_inblock, rus.ru_oublock); - (*enumerator)(cptr, buf); - + (*enumerator) (cptr, buf); + sprintf(buf, "Msg Rcv %ld Send %ld", rus.ru_msgrcv, rus.ru_msgsnd); - (*enumerator)(cptr, buf); + (*enumerator) (cptr, buf); sprintf(buf, "Signals %ld Context Vol. %ld Invol %ld", - rus.ru_nsignals, rus.ru_nvcsw, rus.ru_nivcsw); - (*enumerator)(cptr, buf); + rus.ru_nsignals, rus.ru_nvcsw, rus.ru_nivcsw); + (*enumerator) (cptr, buf); #else /* HAVE_GETRUSAGE */ #if HAVE_TIMES @@ -126,9 +126,9 @@ return 0; secs = tmsbuf.tms_utime + tmsbuf.tms_stime; - sprintf(buf, "CPU Secs %d:%d User %d:%d System %d:%d", - mins, secs, umin, usec, smin, ssec); - (*enumerator)(cptr, buf); + sprintf(buf, "CPU Secs %d:%d User %d:%d System %d:%d", + mins, secs, umin, usec, smin, ssec); + (*enumerator) (cptr, buf); #endif /* HAVE_TIMES */ #endif /* HAVE_GETRUSAGE */ return 1; @@ -136,7 +136,7 @@ int os_get_sockerr(int fd) { - int err = 0; + int err = 0; #if defined(SO_ERROR) unsigned int len = sizeof(err); getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &len); @@ -194,17 +194,17 @@ int os_set_reuseaddr(int fd) { unsigned int opt = 1; - return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, - (const char*) &opt, sizeof(opt))); + return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, + (const char *)&opt, sizeof(opt))); } int os_set_sockbufs(int fd, unsigned int size) { unsigned int opt = size; - return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, - (const char*) &opt, sizeof(opt)) && - 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, - (const char*) &opt, sizeof(opt))); + return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, + (const char *)&opt, sizeof(opt)) && + 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, + (const char *)&opt, sizeof(opt))); } int os_disable_options(int fd) @@ -239,18 +239,19 @@ #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_FD_MAX) struct rlimit limit; - if (!getrlimit(RLIMIT_FD_MAX, &limit)) { + if (!getrlimit(RLIMIT_FD_MAX, &limit)) + { if (limit.rlim_max < MAXCONNECTIONS) return limit.rlim_max; - limit.rlim_cur = limit.rlim_max; /* make soft limit the max */ + limit.rlim_cur = limit.rlim_max; /* make soft limit the max */ return setrlimit(RLIMIT_FD_MAX, &limit); } #endif /* defined(HAVE_SETRLIMIT) && defined(RLIMIT_FD_MAX) */ return 0; } -IOResult os_recv_nonb(int fd, char* buf, unsigned int length, - unsigned int* count_out) +IOResult os_recv_nonb(int fd, char *buf, unsigned int length, + unsigned int *count_out) { int res; assert(0 != buf); @@ -258,16 +259,18 @@ *count_out = 0; errno = 0; - if (0 < (res = recv(fd, buf, length, 0))) { - *count_out = (unsigned) res; + if (0 < (res = recv(fd, buf, length, 0))) + { + *count_out = (unsigned)res; return IO_SUCCESS; } - else if (res < 0) { + else if (res < 0) + { if (EWOULDBLOCK == errno || EAGAIN == errno) return IO_BLOCKED; else return IO_FAILURE; - } + } /* * 0 == client closed the connection * < 1 == error @@ -275,10 +278,10 @@ return IO_FAILURE; } -IOResult os_recvfrom_nonb(int fd, char* buf, unsigned int length, - unsigned int* length_out, struct sockaddr_in* sin_out) +IOResult os_recvfrom_nonb(int fd, char *buf, unsigned int length, + unsigned int *length_out, struct sockaddr_in * sin_out) { - int res; + int res; unsigned int len = sizeof(struct sockaddr_in); assert(0 != buf); assert(0 != length_out); @@ -286,8 +289,9 @@ errno = 0; *length_out = 0; - res = recvfrom(fd, buf, length, 0, (struct sockaddr*) sin_out, &len); - if (-1 == res) { + res = recvfrom(fd, buf, length, 0, (struct sockaddr *)sin_out, &len); + if (-1 == res) + { if (EWOULDBLOCK == errno || ENOMEM == errno) return IO_BLOCKED; return IO_FAILURE; @@ -296,8 +300,8 @@ return IO_SUCCESS; } -IOResult os_send_nonb(int fd, const char* buf, unsigned int length, - unsigned int* count_out) +IOResult os_send_nonb(int fd, const char *buf, unsigned int length, + unsigned int *count_out) { int res; assert(0 != buf); @@ -305,42 +309,42 @@ *count_out = 0; errno = 0; - if (-1 < (res = send(fd, buf, length, 0))) { - *count_out = (unsigned) res; + if (-1 < (res = send(fd, buf, length, 0))) + { + *count_out = (unsigned)res; return IO_SUCCESS; } - else if (EWOULDBLOCK == errno || EAGAIN == errno || - ENOMEM == errno || ENOBUFS == errno) + else if (EWOULDBLOCK == errno || EAGAIN == errno || + ENOMEM == errno || ENOBUFS == errno) return IO_BLOCKED; return IO_FAILURE; } -int os_connect_nonb(int fd, const struct sockaddr_in* sin) +int os_connect_nonb(int fd, const struct sockaddr_in *sin) { - if (connect(fd, (struct sockaddr*) sin, sizeof(struct sockaddr_in))) { + if (connect(fd, (struct sockaddr *)sin, sizeof(struct sockaddr_in))) + { if (errno != EINPROGRESS) return 0; } return 1; } - -int os_get_sockname(int fd, struct sockaddr_in* sin_out) + +int os_get_sockname(int fd, struct sockaddr_in *sin_out) { unsigned int len = sizeof(struct sockaddr_in); assert(0 != sin_out); - return (0 == getsockname(fd, (struct sockaddr*) sin_out, &len)); + return (0 == getsockname(fd, (struct sockaddr *)sin_out, &len)); } -int os_get_peername(int fd, struct sockaddr_in* sin_out) +int os_get_peername(int fd, struct sockaddr_in *sin_out) { unsigned int len = sizeof(struct sockaddr_in); assert(0 != sin_out); - return (0 == getpeername(fd, (struct sockaddr*) sin_out, &len)); + return (0 == getpeername(fd, (struct sockaddr *)sin_out, &len)); } int os_set_listen(int fd, int backlog) { return (0 == listen(fd, backlog)); } - - Index: os_generic.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/os_generic.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- os_generic.c 18 Aug 2002 22:49:42 -0000 1.1 +++ os_generic.c 18 Aug 2002 22:59:22 -0000 1.2 @@ -79,30 +79,30 @@ secs = 1; sprintf(buf, "CPU Secs %ld:%ld User %ld:%ld System %ld:%ld", - secs / 60, secs % 60, - rus.ru_utime.tv_sec / 60, rus.ru_utime.tv_sec % 60, - rus.ru_stime.tv_sec / 60, rus.ru_stime.tv_sec % 60); - (*enumerator)(cptr, buf); + secs / 60, secs % 60, + rus.ru_utime.tv_sec / 60, rus.ru_utime.tv_sec % 60, + rus.ru_stime.tv_sec / 60, rus.ru_stime.tv_sec % 60); + (*enumerator) (cptr, buf); sprintf(buf, "RSS %ld ShMem %ld Data %ld Stack %ld", - rus.ru_maxrss, - rus.ru_ixrss / (uptime * hzz), rus.ru_idrss / (uptime * hzz), - rus.ru_isrss / (uptime * hzz)); - (*enumerator)(cptr, buf); + rus.ru_maxrss, + rus.ru_ixrss / (uptime * hzz), rus.ru_idrss / (uptime * hzz), + rus.ru_isrss / (uptime * hzz)); + (*enumerator) (cptr, buf); sprintf(buf, "Swaps %ld Reclaims %ld Faults %ld", - rus.ru_nswap, rus.ru_minflt, rus.ru_majflt); - (*enumerator)(cptr, buf); + rus.ru_nswap, rus.ru_minflt, rus.ru_majflt); + (*enumerator) (cptr, buf); sprintf(buf, "Block in %ld out %ld", rus.ru_inblock, rus.ru_oublock); - (*enumerator)(cptr, buf); - + (*enumerator) (cptr, buf); + sprintf(buf, "Msg Rcv %ld Send %ld", rus.ru_msgrcv, rus.ru_msgsnd); - (*enumerator)(cptr, buf); + (*enumerator) (cptr, buf); sprintf(buf, "Signals %ld Context Vol. %ld Invol %ld", - rus.ru_nsignals, rus.ru_nvcsw, rus.ru_nivcsw); - (*enumerator)(cptr, buf); + rus.ru_nsignals, rus.ru_nvcsw, rus.ru_nivcsw); + (*enumerator) (cptr, buf); #else /* HAVE_GETRUSAGE */ #if HAVE_TIMES @@ -129,9 +129,9 @@ return 0; secs = tmsbuf.tms_utime + tmsbuf.tms_stime; - sprintf(buf, "CPU Secs %d:%d User %d:%d System %d:%d", - mins, secs, umin, usec, smin, ssec); - (*enumerator)(cptr, buf); + sprintf(buf, "CPU Secs %d:%d User %d:%d System %d:%d", + mins, secs, umin, usec, smin, ssec); + (*enumerator) (cptr, buf); #endif /* HAVE_TIMES */ #endif /* HAVE_GETRUSAGE */ return 1; @@ -139,7 +139,7 @@ int os_get_sockerr(int fd) { - int err = 0; + int err = 0; #if defined(SO_ERROR) unsigned int len = sizeof(err); getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &len); @@ -197,17 +197,17 @@ int os_set_reuseaddr(int fd) { unsigned int opt = 1; - return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, - (const char*) &opt, sizeof(opt))); + return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, + (const char *)&opt, sizeof(opt))); } int os_set_sockbufs(int fd, unsigned int size) { unsigned int opt = size; - return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, - (const char*) &opt, sizeof(opt)) && - 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, - (const char*) &opt, sizeof(opt))); + return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, + (const char *)&opt, sizeof(opt)) && + 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, + (const char *)&opt, sizeof(opt))); } int os_disable_options(int fd) @@ -242,18 +242,19 @@ #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_FD_MAX) struct rlimit limit; - if (!getrlimit(RLIMIT_FD_MAX, &limit)) { + if (!getrlimit(RLIMIT_FD_MAX, &limit)) + { if (limit.rlim_max < MAXCONNECTIONS) return limit.rlim_max; - limit.rlim_cur = limit.rlim_max; /* make soft limit the max */ + limit.rlim_cur = limit.rlim_max; /* make soft limit the max */ return setrlimit(RLIMIT_FD_MAX, &limit); } #endif /* defined(HAVE_SETRLIMIT) && defined(RLIMIT_FD_MAX) */ return 0; } -IOResult os_recv_nonb(int fd, char* buf, unsigned int length, - unsigned int* count_out) +IOResult os_recv_nonb(int fd, char *buf, unsigned int length, + unsigned int *count_out) { int res; assert(0 != buf); @@ -261,16 +262,18 @@ *count_out = 0; errno = 0; - if (0 < (res = recv(fd, buf, length, 0))) { - *count_out = (unsigned) res; + if (0 < (res = recv(fd, buf, length, 0))) + { + *count_out = (unsigned)res; return IO_SUCCESS; } - else if (res < 0) { + else if (res < 0) + { if (EWOULDBLOCK == errno || EAGAIN == errno) return IO_BLOCKED; else return IO_FAILURE; - } + } /* * 0 == client closed the connection * < 1 == error @@ -278,18 +281,19 @@ return IO_FAILURE; } -IOResult os_recvfrom_nonb(int fd, char* buf, unsigned int length, - unsigned int* length_out, struct sockaddr_in* sin_out) +IOResult os_recvfrom_nonb(int fd, char *buf, unsigned int length, + unsigned int *length_out, struct sockaddr_in * sin_out) { - int res; + int res; unsigned int len = sizeof(struct sockaddr_in); assert(0 != buf); assert(0 != length_out); assert(0 != sin_out); errno = 0; - res = recvfrom(fd, buf, length, 0, (struct sockaddr*) sin_out, &len); - if (-1 == res) { + res = recvfrom(fd, buf, length, 0, (struct sockaddr *)sin_out, &len); + if (-1 == res) + { if (EWOULDBLOCK == errno || ENOMEM == errno) return IO_BLOCKED; return IO_FAILURE; @@ -298,8 +302,8 @@ return IO_SUCCESS; } -IOResult os_send_nonb(int fd, const char* buf, unsigned int length, - unsigned int* count_out) +IOResult os_send_nonb(int fd, const char *buf, unsigned int length, + unsigned int *count_out) { int res; assert(0 != buf); @@ -307,42 +311,42 @@ *count_out = 0; errno = 0; - if (-1 < (res = send(fd, buf, length, 0))) { - *count_out = (unsigned) res; + if (-1 < (res = send(fd, buf, length, 0))) + { + *count_out = (unsigned)res; return IO_SUCCESS; } - else if (EWOULDBLOCK == errno || EAGAIN == errno || - ENOMEM == errno || ENOBUFS == errno) + else if (EWOULDBLOCK == errno || EAGAIN == errno || + ENOMEM == errno || ENOBUFS == errno) return IO_BLOCKED; return IO_FAILURE; } -int os_connect_nonb(int fd, const struct sockaddr_in* sin) +int os_connect_nonb(int fd, const struct sockaddr_in *sin) { - if (connect(fd, (struct sockaddr*) sin, sizeof(struct sockaddr_in))) { + if (connect(fd, (struct sockaddr *)sin, sizeof(struct sockaddr_in))) + { if (errno != EINPROGRESS) return 0; } return 1; } - -int os_get_sockname(int fd, struct sockaddr_in* sin_out) + +int os_get_sockname(int fd, struct sockaddr_in *sin_out) { unsigned int len = sizeof(struct sockaddr_in); assert(0 != sin_out); - return (0 == getsockname(fd, (struct sockaddr*) sin_out, &len)); + return (0 == getsockname(fd, (struct sockaddr *)sin_out, &len)); } -int os_get_peername(int fd, struct sockaddr_in* sin_out) +int os_get_peername(int fd, struct sockaddr_in *sin_out) { unsigned int len = sizeof(struct sockaddr_in); assert(0 != sin_out); - return (0 == getpeername(fd, (struct sockaddr*) sin_out, &len)); + return (0 == getpeername(fd, (struct sockaddr *)sin_out, &len)); } int os_set_listen(int fd, int backlog) { return (0 == listen(fd, backlog)); } - - Index: os_linux.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/os_linux.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- os_linux.c 18 Aug 2002 22:49:42 -0000 1.1 +++ os_linux.c 18 Aug 2002 22:59:22 -0000 1.2 @@ -70,30 +70,30 @@ secs = 1; sprintf(buf, "CPU Secs %ld:%ld User %ld:%ld System %ld:%ld", - secs / 60, secs % 60, - rus.ru_utime.tv_sec / 60, rus.ru_utime.tv_sec % 60, - rus.ru_stime.tv_sec / 60, rus.ru_stime.tv_sec % 60); - (*enumerator)(cptr, buf); + secs / 60, secs % 60, + rus.ru_utime.tv_sec / 60, rus.ru_utime.tv_sec % 60, + rus.ru_stime.tv_sec / 60, rus.ru_stime.tv_sec % 60); + (*enumerator) (cptr, buf); sprintf(buf, "RSS %ld ShMem %ld Data %ld Stack %ld", - rus.ru_maxrss, - rus.ru_ixrss / tick_count, rus.ru_idrss / tick_count, - rus.ru_isrss / tick_count); - (*enumerator)(cptr, buf); + rus.ru_maxrss, + rus.ru_ixrss / tick_count, rus.ru_idrss / tick_count, + rus.ru_isrss / tick_count); + (*enumerator) (cptr, buf); sprintf(buf, "Swaps %ld Reclaims %ld Faults %ld", - rus.ru_nswap, rus.ru_minflt, rus.ru_majflt); - (*enumerator)(cptr, buf); + rus.ru_nswap, rus.ru_minflt, rus.ru_majflt); + (*enumerator) (cptr, buf); sprintf(buf, "Block in %ld out %ld", rus.ru_inblock, rus.ru_oublock); - (*enumerator)(cptr, buf); - + (*enumerator) (cptr, buf); + sprintf(buf, "Msg Rcv %ld Send %ld", rus.ru_msgrcv, rus.ru_msgsnd); - (*enumerator)(cptr, buf); + (*enumerator) (cptr, buf); sprintf(buf, "Signals %ld Context Vol. %ld Invol %ld", - rus.ru_nsignals, rus.ru_nvcsw, rus.ru_nivcsw); - (*enumerator)(cptr, buf); + rus.ru_nsignals, rus.ru_nvcsw, rus.ru_nivcsw); + (*enumerator) (cptr, buf); if (times(&tmsbuf) == -1) return 0; @@ -106,15 +106,15 @@ mins = (secs / 60) + umin + smin; secs %= HZ; - sprintf(buf, "CPU Secs %ld:%ld User %d:%d System %d:%d", - mins, secs, umin, usec, smin, ssec); - (*enumerator)(cptr, buf); + sprintf(buf, "CPU Secs %ld:%ld User %d:%d System %d:%d", + mins, secs, umin, usec, smin, ssec); + (*enumerator) (cptr, buf); return 1; } int os_get_sockerr(int fd) { - int err = 0; + int err = 0; unsigned int len = sizeof(err); getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &len); return err; @@ -149,7 +149,7 @@ { unsigned int opt = size; return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &opt, sizeof(opt)) && - 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &opt, sizeof(opt))); + 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &opt, sizeof(opt))); } int os_disable_options(int fd) @@ -161,10 +161,11 @@ { struct rlimit limit; - if (!getrlimit(RLIMIT_NOFILE, &limit)) { + if (!getrlimit(RLIMIT_NOFILE, &limit)) + { if (limit.rlim_max < max_descriptors) return limit.rlim_max; - limit.rlim_cur = limit.rlim_max; /* make soft limit the max */ + limit.rlim_cur = limit.rlim_max; /* make soft limit the max */ return setrlimit(RLIMIT_NOFILE, &limit); } return 0; @@ -179,8 +180,8 @@ * 0 if socket closed from other end * -1 if an unrecoverable error occurred */ -IOResult os_recv_nonb(int fd, char* buf, unsigned int length, - unsigned int* count_out) +IOResult os_recv_nonb(int fd, char *buf, unsigned int length, + unsigned int *count_out) { int res; assert(0 != buf); @@ -188,16 +189,18 @@ *count_out = 0; errno = 0; - if (0 < (res = recv(fd, buf, length, 0))) { - *count_out = (unsigned) res; + if (0 < (res = recv(fd, buf, length, 0))) + { + *count_out = (unsigned)res; return IO_SUCCESS; } - else if (res < 0) { + else if (res < 0) + { if (EWOULDBLOCK == errno || EAGAIN == errno) return IO_BLOCKED; else return IO_FAILURE; - } + } /* * 0 == client closed the connection * < 1 == error @@ -205,18 +208,19 @@ return IO_FAILURE; } -IOResult os_recvfrom_nonb(int fd, char* buf, unsigned int length, - unsigned int* length_out, struct sockaddr_in* sin_out) +IOResult os_recvfrom_nonb(int fd, char *buf, unsigned int length, + unsigned int *length_out, struct sockaddr_in * sin_out) { - int res; + int res; unsigned int len = sizeof(struct sockaddr_in); assert(0 != buf); assert(0 != length_out); assert(0 != sin_out); errno = 0; - res = recvfrom(fd, buf, length, 0, (struct sockaddr*) sin_out, &len); - if (-1 == res) { + res = recvfrom(fd, buf, length, 0, (struct sockaddr *)sin_out, &len); + if (-1 == res) + { if (EWOULDBLOCK == errno || ENOMEM == errno) return IO_BLOCKED; return IO_FAILURE; @@ -234,8 +238,8 @@ * 0 if write call blocked, recoverable error * -1 if an unrecoverable error occurred */ -IOResult os_send_nonb(int fd, const char* buf, unsigned int length, - unsigned int* count_out) +IOResult os_send_nonb(int fd, const char *buf, unsigned int length, + unsigned int *count_out) { int res; assert(0 != buf); @@ -243,8 +247,9 @@ *count_out = 0; errno = 0; - if (-1 < (res = send(fd, buf, length, 0))) { - *count_out = (unsigned) res; + if (-1 < (res = send(fd, buf, length, 0))) + { + *count_out = (unsigned)res; return IO_SUCCESS; } else if (EAGAIN == errno || ENOMEM == errno || ENOBUFS == errno) @@ -254,27 +259,28 @@ } -int os_connect_nonb(int fd, const struct sockaddr_in* sin) +int os_connect_nonb(int fd, const struct sockaddr_in *sin) { - if (connect(fd, (const struct sockaddr*) sin, sizeof(struct sockaddr_in))) { + if (connect(fd, (const struct sockaddr *)sin, sizeof(struct sockaddr_in))) + { if (errno != EINPROGRESS) return 0; } return 1; } - -int os_get_sockname(int fd, struct sockaddr_in* sin_out) + +int os_get_sockname(int fd, struct sockaddr_in *sin_out) { unsigned int len = sizeof(struct sockaddr_in); assert(0 != sin_out); - return (0 == getsockname(fd, (struct sockaddr*) sin_out, &len)); + return (0 == getsockname(fd, (struct sockaddr *)sin_out, &len)); } -int os_get_peername(int fd, struct sockaddr_in* sin_out) +int os_get_peername(int fd, struct sockaddr_in *sin_out) { unsigned int len = sizeof(struct sockaddr_in); assert(0 != sin_out); - return (0 == getpeername(fd, (struct sockaddr*) sin_out, &len)); + return (0 == getpeername(fd, (struct sockaddr *)sin_out, &len)); } int os_set_listen(int fd, int backlog) @@ -286,4 +292,3 @@ */ return (0 == listen(fd, backlog)); } - Index: os_solaris.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/os_solaris.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- os_solaris.c 18 Aug 2002 22:49:42 -0000 1.1 +++ os_solaris.c 18 Aug 2002 22:59:22 -0000 1.2 @@ -46,8 +46,8 @@ char buf[256]; struct rusage rus; time_t secs; - int hz = HZ; - int upticks = uptime * hz; + int hz = HZ; + int upticks = uptime * hz; assert(0 != enumerator); if (getrusage(RUSAGE_SELF, &rus) == -1) @@ -58,30 +58,29 @@ secs = 1; sprintf(buf, "CPU Secs %ld:%ld User %ld:%ld System %ld:%ld", - secs / 60, secs % 60, - rus.ru_utime.tv_sec / 60, rus.ru_utime.tv_sec % 60, - rus.ru_stime.tv_sec / 60, rus.ru_stime.tv_sec % 60); - (*enumerator)(cptr, buf); + secs / 60, secs % 60, + rus.ru_utime.tv_sec / 60, rus.ru_utime.tv_sec % 60, + rus.ru_stime.tv_sec / 60, rus.ru_stime.tv_sec % 60); + (*enumerator) (cptr, buf); sprintf(buf, "RSS %ld ShMem %ld Data %ld Stack %ld", - rus.ru_maxrss, - rus.ru_ixrss / upticks, rus.ru_idrss / upticks, - rus.ru_isrss / upticks); - (*enumerator)(cptr, buf); + rus.ru_maxrss, + rus.ru_ixrss / upticks, rus.ru_idrss / upticks, rus.ru_isrss / upticks); + (*enumerator) (cptr, buf); sprintf(buf, "Swaps %ld Reclaims %ld Faults %ld", - rus.ru_nswap, rus.ru_minflt, rus.ru_majflt); - (*enumerator)(cptr, buf); + rus.ru_nswap, rus.ru_minflt, rus.ru_majflt); + (*enumerator) (cptr, buf); sprintf(buf, "Block in %ld out %ld", rus.ru_inblock, rus.ru_oublock); - (*enumerator)(cptr, buf); - + (*enumerator) (cptr, buf); + sprintf(buf, "Msg Rcv %ld Send %ld", rus.ru_msgrcv, rus.ru_msgsnd); - (*enumerator)(cptr, buf); + (*enumerator) (cptr, buf); sprintf(buf, "Signals %ld Context Vol. %ld Invol %ld", - rus.ru_nsignals, rus.ru_nvcsw, rus.ru_nivcsw); - (*enumerator)(cptr, buf); + rus.ru_nsignals, rus.ru_nvcsw, rus.ru_nivcsw); + (*enumerator) (cptr, buf); return 1; } @@ -90,7 +89,7 @@ { int err = 0; int len = sizeof(err); - getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*) &err, &len); + getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&err, &len); return err; } @@ -115,17 +114,17 @@ int os_set_reuseaddr(int fd) { unsigned int opt = 1; - return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, - (const char*) &opt, sizeof(opt))); + return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, + (const char *)&opt, sizeof(opt))); } int os_set_sockbufs(int fd, unsigned int size) { unsigned int opt = size; - return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, - (const char*) &opt, sizeof(opt)) && - 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, - (const char*) &opt, sizeof(opt))); + return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, + (const char *)&opt, sizeof(opt)) && + 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, + (const char *)&opt, sizeof(opt))); } int os_disable_options(int fd) @@ -137,17 +136,18 @@ { struct rlimit limit; - if (!getrlimit(RLIMIT_NOFILE, &limit)) { + if (!getrlimit(RLIMIT_NOFILE, &limit)) + { if (limit.rlim_max < max_descriptors) return limit.rlim_max; - limit.rlim_cur = limit.rlim_max; /* make soft limit the max */ + limit.rlim_cur = limit.rlim_max; /* make soft limit the max */ return setrlimit(RLIMIT_NOFILE, &limit); } return 0; } -IOResult os_recv_nonb(int fd, char* buf, unsigned int length, - unsigned int* count_out) +IOResult os_recv_nonb(int fd, char *buf, unsigned int length, + unsigned int *count_out) { int res; assert(0 != buf); @@ -155,17 +155,19 @@ *count_out = 0; errno = 0; - if (0 < (res = recv(fd, buf, length, 0))) { - *count_out = (unsigned) res; + if (0 < (res = recv(fd, buf, length, 0))) + { + *count_out = (unsigned)res; return IO_SUCCESS; } - else if (res < 0) { - if (EAGAIN == errno || ENOBUFS == errno || - ENOMEM == errno || ENOSR == errno) + else if (res < 0) + { + if (EAGAIN == errno || ENOBUFS == errno || + ENOMEM == errno || ENOSR == errno) return IO_BLOCKED; else return IO_FAILURE; - } + } /* * 0 == client closed the connection * < 1 == error @@ -173,20 +175,21 @@ return IO_FAILURE; } -IOResult os_recvfrom_nonb(int fd, char* buf, unsigned int length, - unsigned int* length_out, struct sockaddr_in* sin_out) +IOResult os_recvfrom_nonb(int fd, char *buf, unsigned int length, + unsigned int *length_out, struct sockaddr_in * sin_out) { - int res; + int res; unsigned int len = sizeof(struct sockaddr_in); assert(0 != buf); assert(0 != length_out); assert(0 != sin_out); errno = 0; - res = recvfrom(fd, buf, length, 0, (struct sockaddr*) sin_out, &len); - if (-1 == res) { - if (EAGAIN == errno || ENOBUFS == errno || - ENOMEM == errno || ENOSR == errno) + res = recvfrom(fd, buf, length, 0, (struct sockaddr *)sin_out, &len); + if (-1 == res) + { + if (EAGAIN == errno || ENOBUFS == errno || + ENOMEM == errno || ENOSR == errno) return IO_BLOCKED; return IO_FAILURE; } @@ -194,8 +197,8 @@ return IO_SUCCESS; } -IOResult os_send_nonb(int fd, const char* buf, unsigned int length, - unsigned int* count_out) +IOResult os_send_nonb(int fd, const char *buf, unsigned int length, + unsigned int *count_out) { int res; assert(0 != buf); @@ -203,42 +206,43 @@ *count_out = 0; errno = 0; - if (-1 < (res = send(fd, buf, length, 0))) { - *count_out = (unsigned) res; + if (-1 < (res = send(fd, buf, length, 0))) + { + *count_out = (unsigned)res; return IO_SUCCESS; } - else if (EAGAIN == errno || ENOBUFS == errno || - ENOMEM == errno || ENOSR == errno) + else if (EAGAIN == errno || ENOBUFS == errno || + ENOMEM == errno || ENOSR == errno) return IO_BLOCKED; return IO_FAILURE; } -int os_connect_nonb(int fd, const struct sockaddr_in* sin) +int os_connect_nonb(int fd, const struct sockaddr_in *sin) { - if (connect(fd, (struct sockaddr*) sin, sizeof(struct sockaddr_in))) { + if (connect(fd, (struct sockaddr *)sin, sizeof(struct sockaddr_in))) + { if (errno != EINPROGRESS) return 0; } return 1; } - -int os_get_sockname(int fd, struct sockaddr_in* sin_out) + +int os_get_sockname(int fd, struct sockaddr_in *sin_out) { int len = sizeof(struct sockaddr_in); assert(0 != sin_out); - return (0 == getsockname(fd, (struct sockaddr*) sin_out, &len)); + return (0 == getsockname(fd, (struct sockaddr *)sin_out, &len)); } -int os_get_peername(int fd, struct sockaddr_in* sin_out) +int os_get_peername(int fd, struct sockaddr_in *sin_out) { int len = sizeof(struct sockaddr_in); assert(0 != sin_out); - return (0 == getpeername(fd, (struct sockaddr*) sin_out, &len)); + return (0 == getpeername(fd, (struct sockaddr *)sin_out, &len)); } int os_set_listen(int fd, int backlog) { return (0 == listen(fd, backlog)); } - Index: querycmds.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/querycmds.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- querycmds.c 15 Aug 2002 20:55:24 -0000 1.2 +++ querycmds.c 18 Aug 2002 22:59:22 -0000 1.3 @@ -260,8 +260,8 @@ sendto_one(sptr, rpl_str(RPL_LOCALUSERS), me.name, parv[0], UserStats.local_clients, max_client_count, date(max_client_count_TS)); - sendto_one(sptr, rpl_str(RPL_GLOBALUSERS), me.name, parv[0], UserStats.clients, - max_global_count, date(max_global_count_TS)); + sendto_one(sptr, rpl_str(RPL_GLOBALUSERS), me.name, parv[0], + UserStats.clients, max_global_count, date(max_global_count_TS)); return 0; } @@ -281,7 +281,8 @@ return 0; sendto_one(sptr, rpl_str(RPL_LUSERCLIENT), me.name, parv[0], - UserStats.clients - UserStats.inv_clients, UserStats.inv_clients, UserStats.servers); + UserStats.clients - UserStats.inv_clients, UserStats.inv_clients, + UserStats.servers); if (UserStats.opers) sendto_one(sptr, rpl_str(RPL_LUSEROP), me.name, parv[0], UserStats.opers); if (UserStats.unknowns > 0) @@ -290,8 +291,8 @@ if (UserStats.channels > 0) sendto_one(sptr, rpl_str(RPL_LUSERCHANNELS), me.name, parv[0], UserStats.channels); - sendto_one(sptr, rpl_str(RPL_LUSERME), me.name, parv[0], UserStats.local_clients, - UserStats.local_servers); + sendto_one(sptr, rpl_str(RPL_LUSERME), me.name, parv[0], + UserStats.local_clients, UserStats.local_servers); return 0; } Index: s_auth.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_auth.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- s_auth.c 18 Aug 2002 22:49:42 -0000 1.3 +++ s_auth.c 18 Aug 2002 22:59:22 -0000 1.4 @@ -41,7 +41,7 @@ #ifdef USE_SYSLOG #include <syslog.h> #endif -#include <errno.h> +#include <errno.h> #include "h.h" #include "res.h" #include "struct.h" Index: s_bsd.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_bsd.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- s_bsd.c 18 Aug 2002 22:49:42 -0000 1.4 +++ s_bsd.c 18 Aug 2002 22:59:22 -0000 1.5 @@ -64,7 +64,7 @@ #include <arpa/inet.h> #include <arpa/nameser.h> #include <resolv.h> -#include <errno.h> +#include <errno.h> #include <fcntl.h> #include "h.h" #include "res.h" Index: s_conf.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_conf.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- s_conf.c 18 Aug 2002 22:49:42 -0000 1.5 +++ s_conf.c 18 Aug 2002 22:59:22 -0000 1.6 @@ -491,7 +491,7 @@ * find a conf entry which matches the hostname and has the same name. */ struct ConfItem *find_conf_exact(const char *name, const char *user, - const char *host, int statmask) + const char *host, int statmask) { Reg1 aConfItem *tmp; char userhost[USERLEN + HOSTLEN + 3]; @@ -604,7 +604,8 @@ { Reg1 aConfItem *bconf; - for (bconf = GlobalConfList, mask &= ~CONF_ILLEGAL; bconf; bconf = bconf->next) + for (bconf = GlobalConfList, mask &= ~CONF_ILLEGAL; bconf; + bconf = bconf->next) { if (!(bconf->status & mask) || (bconf->port != aconf->port)) continue; @@ -1235,7 +1236,7 @@ for (tmp = GlobalConfList; tmp; tmp = tmp->next) if (tmp->status == CONF_TLINES && tmp->host && tmp->passwd) { - temp = (struct TRecord *) RunMalloc(sizeof(struct TRecord)); + temp = (struct TRecord *)RunMalloc(sizeof(struct TRecord)); if (!temp) outofmemory(); temp->hostmask = tmp->host; Index: s_debug.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_debug.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- s_debug.c 18 Aug 2002 22:49:43 -0000 1.3 +++ s_debug.c 18 Aug 2002 22:59:22 -0000 1.4 @@ -47,7 +47,7 @@ #include <errno.h> #include <fcntl.h> #include <stdarg.h> -#include <stddef.h> /* offsetof */ +#include <stddef.h> /* offsetof */ #include <stdio.h> #include <string.h> #include <unistd.h> @@ -351,20 +351,24 @@ void open_debugfile(void) { #ifdef DEBUGMODE - if (debuglevel >= 0) { + if (debuglevel >= 0) + { printf("isatty = %d ttyname = %#x\n", isatty(2), (unsigned int)ttyname(2)); - if (!(bootopt & BOOT_TTY)) { + if (!(bootopt & BOOT_TTY)) + { int fd; /* * leave debugging output on fd 2 */ - if ((fd = open(LOGFILE, O_CREAT | O_WRONLY | O_APPEND, 0600)) < 0) { - if ((fd = open("/dev/null", O_WRONLY)) < 0) - exit(-1); + if ((fd = open(LOGFILE, O_CREAT | O_WRONLY | O_APPEND, 0600)) < 0) + { + if ((fd = open("/dev/null", O_WRONLY)) < 0) + exit(-1); } - if (fd != 2) { - dup2(fd, 2); - close(fd); + if (fd != 2) + { + dup2(fd, 2); + close(fd); } } } @@ -432,7 +436,7 @@ struct ConfClass *cltmp; #if 0 struct Watch *watch; - struct Membership *member; + struct Membership *member; #endif int lc = 0, /* local clients */ @@ -447,7 +451,7 @@ cl = 0, /* classes */ co = 0; /* conf lines */ #if 0 - wt = 0, /* watch entries */ + wt = 0, /* watch entries */ memberships = 0; /* channel memberships */ #endif @@ -549,9 +553,9 @@ usi * sizeof(struct SLink)); #if 0 sendto_one(cptr, - ":%s %d %s :User channels %d(" SIZE_T_FMT ") Aways %d(" SIZE_T_FMT ")", - me.name, RPL_STATSDEBUG, nick, memberships, - memberships * sizeof(struct Membership), aw, awm); + ":%s %d %s :User channels %d(" SIZE_T_FMT ") Aways %d(" SIZE_T_FMT ")", + me.name, RPL_STATSDEBUG, nick, memberships, + memberships * sizeof(struct Membership), aw, awm); #else sendto_one(cptr, ":%s %d %s :User channels %d(" SIZE_T_FMT ") Aways %d(" SIZE_T_FMT ")", @@ -560,7 +564,8 @@ sendto_one(cptr, ":%s %d %s :Attached confs %d(" SIZE_T_FMT ")", me.name, RPL_STATSDEBUG, nick, lcc, lcc * sizeof(struct SLink)); - totcl = lcm + rcm + us * sizeof(struct User) + usc * sizeof(struct SLink) + awm; + totcl = + lcm + rcm + us * sizeof(struct User) + usc * sizeof(struct SLink) + awm; totcl += lcc * sizeof(struct SLink) + usi * sizeof(struct SLink); sendto_one(cptr, ":%s %d %s :Conflines %d(" SIZE_T_FMT ")", Index: s_misc.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_misc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- s_misc.c 15 Aug 2002 20:55:24 -0000 1.2 +++ s_misc.c 18 Aug 2002 22:59:22 -0000 1.3 @@ -97,7 +97,7 @@ * stats stuff */ static struct ServerStatistics ircst; -struct ServerStatistics* ServerStats = &ircst; +struct ServerStatistics *ServerStats = &ircst; char *date(time_t clock) { @@ -358,11 +358,11 @@ * --Run */ int exit_client(struct Client *cptr, /* Connection being handled by - read_message right now */ - struct Client *bcptr, /* Client being killed */ - struct Client *sptr, /* The client that made the decision + read_message right now */ + struct Client *bcptr, /* Client being killed */ + struct Client *sptr, /* The client that made the decision to remove this one, never NULL */ - const char *comment) /* Reason for the exit */ + const char *comment) /* Reason for the exit */ { Reg1 aClient *acptr; Reg3 struct DLink *dlp; @@ -500,8 +500,8 @@ /* * Exit client with formatted message, added 25-9-94 by Run */ -int vexit_client_msg(struct Client *cptr, struct Client *bcptr, struct Client *sptr, - const char *pattern, va_list vl) +int vexit_client_msg(struct Client *cptr, struct Client *bcptr, + struct Client *sptr, const char *pattern, va_list vl) { char msgbuf[1024]; vsprintf_irc(msgbuf, pattern, vl); Index: s_serv.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_serv.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- s_serv.c 15 Aug 2002 20:55:24 -0000 1.2 +++ s_serv.c 18 Aug 2002 22:59:22 -0000 1.3 @@ -647,7 +647,7 @@ * at the second youngest link, assuming it isn't * a REAL loop. */ - ghost = CurrentTime; /* Mark that it caused a ghost */ + ghost = CurrentTime; /* Mark that it caused a ghost */ if (exit_client(cptr, acptr, &me, "Ghost") == CPTR_KILLED) return CPTR_KILLED; break; Index: s_user.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/s_user.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- s_user.c 15 Aug 2002 20:55:24 -0000 1.5 +++ s_user.c 18 Aug 2002 22:59:22 -0000 1.6 @@ -1150,7 +1150,8 @@ * --zoltan */ - if (hacer_ghost && MyConnect(sptr) && (reg) && (CurrentTime >= cptr->nextnick)) + if (hacer_ghost && MyConnect(sptr) && (reg) + && (CurrentTime >= cptr->nextnick)) { if (parc >= 3) clave_ok = verifica_clave_nick(reg->clave, reg->valor, parv[2]); @@ -1936,7 +1937,8 @@ { #ifdef GODMODE sendto_one(sptr, ":%s NOTICE %s :New target: %s; ft " TIME_T_FMT, - me.name, sptr->name, name, (CurrentTime - sptr->nexttarget) / TARGET_DELAY); + me.name, sptr->name, name, + (CurrentTime - sptr->nexttarget) / TARGET_DELAY); #endif sptr->nexttarget += TARGET_DELAY; if (sptr->nexttarget < CurrentTime - (TARGET_DELAY * (MAXTARGETS - 1))) Index: send.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/send.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- send.c 18 Aug 2002 22:49:43 -0000 1.3 +++ send.c 18 Aug 2002 22:59:22 -0000 1.4 @@ -98,12 +98,15 @@ void flush_connections(struct Client *cptr) { - if (cptr) { + if (cptr) + { send_queued(cptr); } - else { + else + { int i; - for (i = highest_fd; i >= 0; i--) { + for (i = highest_fd; i >= 0; i--) + { if ((cptr = loc_clients[i])) send_queued(cptr); } Index: support.c =================================================================== RCS file: /cvsroot/irc-dev/ircdh/ircd/support.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- support.c 18 Aug 2002 22:49:43 -0000 1.2 +++ support.c 18 Aug 2002 22:59:22 -0000 1.3 @@ -128,6 +128,7 @@ return buf; } + #if 0 #ifndef HAVE_INET_NETOF /* |