1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-30 11:26:38 +02:00

- More refactoring related to local[] removal.

This commit is contained in:
William Pitcock
2012-11-25 02:59:48 +00:00
parent 56010d9fb5
commit 4efcdfe090
3 changed files with 33 additions and 37 deletions
+2 -9
View File
@@ -1713,10 +1713,7 @@ static void open_debugfile(void)
SetLog(cptr);
cptr->port = debuglevel;
cptr->flags = 0;
cptr->listener = cptr;
/*
* local[2] = cptr; winlocal
*/
(void)strlcpy(cptr->sockhost, me.sockhost,
sizeof cptr->sockhost);
# ifndef _WIN32
@@ -1740,12 +1737,8 @@ static void open_debugfile(void)
Debug((DEBUG_FATAL,
"Debug: File <%s> Level: %d at %s", cptr->name,
cptr->port, myctime(time(NULL))));
} else
/*
* local[2] = NULL; winlocal
*/
}
#endif
return;
}
static void setup_signals()
+31 -21
View File
@@ -175,28 +175,39 @@ void remove_local_client(aClient* cptr)
void close_connections(void)
{
aClient* cptr;
int i = LastSlot;
aClient* cptr;
list_for_each_entry(cptr, &lclient_list, lclient_node)
{
if (cptr->fd >= 0)
{
fd_close(cptr->fd);
cptr->fd = -2;
}
}
list_for_each_entry(cptr, &unknown_list, lclient_node)
{
if (cptr->fd >= 0)
{
fd_close(cptr->fd);
cptr->fd = -2;
}
if (cptr->authfd >= 0)
{
fd_close(cptr->authfd);
cptr->fd = -1;
}
}
close_listeners();
OpenFiles = 0;
LastSlot = -1;
for ( ; i >= 0; --i)
{
if ((cptr = local[i]) != 0)
{
if (cptr->fd >= 0) {
fd_close(cptr->fd);
cptr->fd = -2;
}
if (cptr->authfd >= 0)
{
fd_close(cptr->authfd);
cptr->authfd = -1;
}
}
}
OpenFiles = 0;
LastSlot = -1;
#ifdef _WIN32
WSACleanup();
WSACleanup();
#endif
}
@@ -642,7 +653,6 @@ if ((bootopt & BOOT_CONSOLE) || isatty(0))
#ifndef NOCLOSEFD
(void)close(0); /* fd 0 opened by inetd */
#endif
local[0] = NULL;
}
init_dgram:
#else
-7
View File
@@ -214,13 +214,6 @@ void debug(int level, char *form, ...)
#endif
#endif
#if 0
if (local[2])
{
local[2]->sendM++;
local[2]->sendB += strlen(debugbuf);
}
#endif
#ifndef _WIN32
(void)fprintf(stderr, "%s", debugbuf);
(void)fputc('\n', stderr);