dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/31674 )

Change subject: pcu_sock: rename rc to fd
......................................................................

pcu_sock: rename rc to fd

The variable rc holds the return code of accept(), which returns a file
descriptor on success. So lets call the variable "fd" to make this
clear.

Change-Id: Ibc359d941786b1d1d52b356e239a76a090b52c1f
---
M src/common/pcu_sock.c
1 file changed, 18 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve




diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index bdf5958..b0fd936 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -1160,11 +1160,11 @@
        struct osmo_fd *conn_bfd = &state->conn_bfd;
        struct sockaddr_un un_addr;
        socklen_t len;
-       int rc;
+       int fd;

        len = sizeof(un_addr);
-       rc = accept(bfd->fd, (struct sockaddr *) &un_addr, &len);
-       if (rc < 0) {
+       fd = accept(bfd->fd, (struct sockaddr *) &un_addr, &len);
+       if (fd < 0) {
                LOGP(DPCU, LOGL_ERROR, "Failed to accept a new connection\n");
                return -1;
        }
@@ -1174,11 +1174,11 @@
                        "another active connection ?!?\n");
                /* We already have one PCU connected, this is all we support */
                state->listen_bfd.when &= ~OSMO_FD_READ;
-               close(rc);
+               close(fd);
                return 0;
        }

-       osmo_fd_setup(conn_bfd, rc, OSMO_FD_READ, pcu_sock_cb, state, 0);
+       osmo_fd_setup(conn_bfd, fd, OSMO_FD_READ, pcu_sock_cb, state, 0);

        if (osmo_fd_register(conn_bfd) != 0) {
                LOGP(DPCU, LOGL_ERROR, "Failed to register new connection "

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/31674
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ibc359d941786b1d1d52b356e239a76a090b52c1f
Gerrit-Change-Number: 31674
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to