FreeCalypso > hg > themwi-system-sw
diff rtp-mgr/ctrl_prot.c @ 180:565477d07418
themwi-rtp-mgr: close file descriptors after sending them across
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 11 Mar 2023 20:41:23 -0800 |
parents | b79d6334f543 |
children | 3962d9345a09 |
line wrap: on
line diff
--- a/rtp-mgr/ctrl_prot.c Sat Mar 11 20:19:14 2023 -0800 +++ b/rtp-mgr/ctrl_prot.c Sat Mar 11 20:41:23 2023 -0800 @@ -20,7 +20,7 @@ extern struct bind_range_cfg bind_range_gsm, bind_range_pstn; -void +static void free_rtp_end(roe) struct rtp_one_end *roe; { @@ -28,6 +28,16 @@ close(roe->rtcp_fd); } +static void +close_fds(fd_list, num_fd) + int *fd_list, num_fd; +{ + int i; + + for (i = 0; i < num_fd; i++) + close(fd_list[i]); +} + void ctrl_message_handler(fd) { @@ -127,4 +137,5 @@ fd_bufptr = (int *) CMSG_DATA(cmsg); bcopy(fd_out, fd_bufptr, sizeof(int) * num_fd); sendmsg(fd, &msg, 0); + close_fds(fd_out, num_fd); }