Use osmo_fd_setup() wherever applicable
Change-Id: Ie093dea96ec8990368695c0c5824e0fe44fb8540
This commit is contained in:
parent
08970c562f
commit
c5989fe180
|
@ -394,10 +394,7 @@ int ipc_sock_init(const char *path, struct ipc_sock_state **global_state_var,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd->when = OSMO_FD_READ;
|
osmo_fd_setup(bfd, bfd->fd, OSMO_FD_READ, sock_callback_fn, state, n);
|
||||||
bfd->cb = sock_callback_fn;
|
|
||||||
bfd->data = state;
|
|
||||||
bfd->priv_nr = n;
|
|
||||||
|
|
||||||
rc = osmo_fd_register(bfd);
|
rc = osmo_fd_register(bfd);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
|
|
@ -236,13 +236,8 @@ int ipc_chan_sock_accept(struct osmo_fd *bfd, unsigned int flags)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn_bfd->fd = rc;
|
|
||||||
conn_bfd->when = OSMO_FD_READ;
|
|
||||||
conn_bfd->cb = ipc_chan_sock_cb;
|
|
||||||
conn_bfd->data = state;
|
|
||||||
|
|
||||||
/* copy chan nr, required for proper bfd<->chan # mapping */
|
/* copy chan nr, required for proper bfd<->chan # mapping */
|
||||||
conn_bfd->priv_nr = bfd->priv_nr;
|
osmo_fd_setup(conn_bfd, rc, OSMO_FD_READ, ipc_chan_sock_cb, state, bfd->priv_nr);
|
||||||
|
|
||||||
if (osmo_fd_register(conn_bfd) != 0) {
|
if (osmo_fd_register(conn_bfd) != 0) {
|
||||||
LOGP(DDEV, LOGL_ERROR,
|
LOGP(DDEV, LOGL_ERROR,
|
||||||
|
|
|
@ -249,10 +249,7 @@ int ipc_sock_accept(struct osmo_fd *bfd, unsigned int flags)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn_bfd->fd = rc;
|
osmo_fd_setup(conn_bfd, rc, OSMO_FD_READ, ipc_sock_cb, state, 0);
|
||||||
conn_bfd->when = OSMO_FD_READ;
|
|
||||||
conn_bfd->cb = ipc_sock_cb;
|
|
||||||
conn_bfd->data = state;
|
|
||||||
|
|
||||||
if (osmo_fd_register(conn_bfd) != 0) {
|
if (osmo_fd_register(conn_bfd) != 0) {
|
||||||
LOGP(DDEV, LOGL_ERROR,
|
LOGP(DDEV, LOGL_ERROR,
|
||||||
|
|
Loading…
Reference in New Issue