From 0a8d49575c77e3ef84d6fa6d346035a2dfbc8039 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 28 Aug 2010 12:41:27 +0200 Subject: s3: Remove some references to smbd_server_fd() --- source3/smbd/server.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 3797ae93da..7d257692e9 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -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 -- -- cgit