aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2023-03-06 12:20:25 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2023-03-06 12:23:08 +0100
commitbdc438299b9932caa1df8723bc35cd5cfaf6061d (patch)
tree4a19e9389f88dc926940879c3decc5ca0682dabe
parentf19f53313963406f36b86a549630effb47000291 (diff)
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
-rw-r--r--src/common/pcu_sock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index bdf5958e..b0fd9360 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -1160,11 +1160,11 @@ static int pcu_sock_accept(struct osmo_fd *bfd, unsigned int flags)
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 @@ static int pcu_sock_accept(struct osmo_fd *bfd, unsigned int flags)
"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 "