| 121 | } |
| 122 | |
| 123 | static int |
| 124 | ff_sys_bind(struct ff_bind_args *args) |
| 125 | { |
| 126 | int bound_fd; |
| 127 | int ret; |
| 128 | |
| 129 | bound_fd = sockaddr_is_bound(args->addr); |
| 130 | if (bound_fd != 0 && bound_fd != args->fd) { |
| 131 | return ff_dup2(bound_fd, args->fd); |
| 132 | } |
| 133 | |
| 134 | ret = ff_bind(args->fd, args->addr, args->addrlen); |
| 135 | if (ret == 0) { |
| 136 | sockaddr_bind(args->fd, args->addr); |
| 137 | } |
| 138 | |
| 139 | return ret; |
| 140 | } |
| 141 | |
| 142 | static int |
| 143 | ff_sys_listen(struct ff_listen_args *args) |
no test coverage detected