]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd_io.cpp
Moved to B3 official
[user/henk/code/inspircd.git] / src / inspircd_io.cpp
index 00842b697d0d6f098857f18d7d9c7b39bd6b07d1..79e91217574b0f843fb97154443e3417273b429e 100644 (file)
@@ -42,13 +42,6 @@ void Exit (int status)
        if (log_file)
                fclose(log_file);
        send_error("Server shutdown.");
-
-       // close down all listening sockets
-       for (int count = 0; count < boundPortCount; count++)
-       {
-               shutdown(openSockfd[count], 2);
-       }
-
        exit (status);
 }
 
@@ -57,11 +50,6 @@ void Killed(int status)
        if (log_file)
                fclose(log_file);
        send_error("Server terminated.");
-        // close down all listening sockets
-       for (int count = 0; count < boundPortCount; count++)
-       {
-               shutdown(openSockfd[count], 2);
-       }
        exit(status);
 }
 
@@ -121,6 +109,7 @@ int DaemonSeed (void)
                exit (0);
        setsid ();
        umask (007);
+       printf("InspIRCd PID: %d\n",getpid());
        /* close stdin, stdout, stderr */
        freopen("/dev/null","w",stdout);
        freopen("/dev/null","w",stderr);
@@ -667,7 +656,7 @@ int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server
 int OpenTCPSocket (void)
 {
        int sockfd;
-       int on = 0;
+       int on = 1;
        struct linger linger = { 0 };
   
        if ((sockfd = socket (AF_INET, SOCK_STREAM, 0)) < 0)
@@ -677,7 +666,7 @@ int OpenTCPSocket (void)
                setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (const char*)&on, sizeof(on));
                /* This is BSD compatible, setting l_onoff to 0 is *NOT* http://web.irc.org/mla/ircd-dev/msg02259.html */
                linger.l_onoff = 1;
-               linger.l_linger = 0;
+               linger.l_linger = 1;
                setsockopt(sockfd, SOL_SOCKET, SO_LINGER, (const char*)&linger,sizeof(linger));
                return (sockfd);
        }