dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/31684 )


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: Ic8d22c2af18477f110a3a9115434314ebca95b25
---
M src/osmo-bsc/pcu_sock.c
1 file changed, 18 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/84/31684/1

diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index 486f364..1d7b061 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -911,14 +911,14 @@
        struct gsm_bts_trx *trx;
        int j;
        socklen_t len;
-       int rc;
+       int fd;

        /* FIXME: allow multiple BTS */
        bts = llist_entry(state->net->bts_list.next, struct gsm_bts, list);

        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) {
                LOG_BTS(bts, DPCU, LOGL_ERROR, "Failed to accept a new 
connection\n");
                return -1;
        }
@@ -927,11 +927,11 @@
                LOG_BTS(bts, DPCU, LOGL_NOTICE, "PCU connects but we already 
have another active connection ?!?\n");
                /* We already have one PCU connected, this is all we support */
                osmo_fd_read_disable(&state->listen_bfd);
-               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) {
                LOG_BTS(bts, DPCU, LOGL_ERROR, "Failed to register new 
connection fd\n");

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ic8d22c2af18477f110a3a9115434314ebca95b25
Gerrit-Change-Number: 31684
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to