* @brief Helper function to close a file descriptor. * * Inspects @a fd and calls close (3) if it has a non-negative value. * * @param fd a file descriptor. * @relates basic_pstreambuf */
| 1352 | * @relates basic_pstreambuf |
| 1353 | */ |
| 1354 | inline void |
| 1355 | close_fd(pstreams::fd_type& fd) |
| 1356 | { |
| 1357 | if (fd >= 0 && ::close(fd) == 0) |
| 1358 | fd = -1; |
| 1359 | } |
| 1360 | |
| 1361 | /** |
| 1362 | * @brief Helper function to close an array of file descriptors. |
no outgoing calls
no test coverage detected