s3: Remove some references to smbd_server_fd()
authorVolker Lendecke <vl@samba.org>
Sat, 28 Aug 2010 10:41:27 +0000 (12:41 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 28 Aug 2010 13:05:27 +0000 (15:05 +0200)
source3/smbd/server.c

index 3797ae93da94afb57e372b2fd3a2fe87cf51d9e0..7d257692e9353969f098fd9ac72abba312e75558 100644 (file)
@@ -388,15 +388,17 @@ static void smbd_accept_connection(struct tevent_context *ev,
                                     struct smbd_open_socket);
        struct sockaddr_storage addr;
        socklen_t in_addrlen = sizeof(addr);
+       int fd;
        pid_t pid = 0;
        uint64_t unique_id;
 
-       smbd_set_server_fd(accept(s->fd, (struct sockaddr *)(void *)&addr,&in_addrlen));
+       fd = accept(s->fd, (struct sockaddr *)(void *)&addr,&in_addrlen);
+       smbd_set_server_fd(fd);
 
-       if (smbd_server_fd() == -1 && errno == EINTR)
+       if (fd == -1 && errno == EINTR)
                return;
 
-       if (smbd_server_fd() == -1) {
+       if (fd == -1) {
                DEBUG(0,("open_sockets_smbd: accept: %s\n",
                         strerror(errno)));
                return;
@@ -409,7 +411,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
        }
 
        if (!allowable_number_of_smbd_processes()) {
-               close(smbd_server_fd());
+               close(fd);
                smbd_set_server_fd(-1);
                return;
        }
@@ -482,7 +484,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
        }
 
        /* The parent doesn't need this socket */
-       close(smbd_server_fd());
+       close(fd);
 
        /* Sun May 6 18:56:14 2001 ackley@cs.unm.edu:
                Clear the closed fd info out of server_fd --