Caller must free. */
| 172 | |
| 173 | /* Caller must free. */ |
| 174 | static struct subd_req *get_req(struct subd *sd, int reply_type) |
| 175 | { |
| 176 | struct subd_req *sr; |
| 177 | |
| 178 | list_for_each(&sd->reqs, sr, list) { |
| 179 | if (sr->type + SUBD_REPLY_OFFSET == reply_type) |
| 180 | return sr; |
| 181 | /* If it's a fail, and that's a valid type. */ |
| 182 | if (sr->type + SUBD_REPLYFAIL_OFFSET == reply_type |
| 183 | && strends(sd->msgname(reply_type), "_REPLYFAIL")) { |
| 184 | sr->num_reply_fds = 0; |
| 185 | return sr; |
| 186 | } |
| 187 | } |
| 188 | return NULL; |
| 189 | } |
| 190 | |
| 191 | static void close_taken_fds(va_list *ap) |
| 192 | { |
no test coverage detected