summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-03-24 18:50:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-03-24 18:50:40 +0000
commit922069afab3804acdd53b5daeef35e6a603d43b2 (patch)
tree5d5942043e20bf370e277f293f33db0124e4bea1 /src/socket.cpp
parent97d1b1791c4af29212cd647c2a327e63f05ab008 (diff)
Fix two things: (1) log gets replaced by a user fd after restart causing debug log to go to a user's status window (!)
(2) restart failing due to segfault within libc (this is because some moron decided that stdin, stdout, and stderr should still be non-null if the files arent actually open!) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6707 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 67931e49b..7a746ba0f 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -55,8 +55,10 @@ ListenSocket::~ListenSocket()
{
if (this->GetFd() > -1)
{
- shutdown(this->fd, 2);
- close(this->fd);
+ ServerInstance->SE->DelFd(this);
+ ServerInstance->Log(DEBUG,"Shut down listener on fd %d", this->fd);
+ if (shutdown(this->fd, 2) || close(this->fd))
+ ServerInstance->Log(DEBUG,"Failed to cancel listener: %s", strerror(errno));
this->fd = -1;
}
}
@@ -419,12 +421,14 @@ bool InspIRCd::BindSocket(int sockfd, int port, char* addr, bool dolisten)
}
else
{
+ this->Log(DEBUG,"New socket binding for %d with listen: %s:%d", sockfd, addr, port);
NonBlocking(sockfd);
return true;
}
}
else
{
+ this->Log(DEBUG,"New socket binding for %d without listen: %s:%d", sockfd, addr, port);
return true;
}
}