*/
void fd_delete(int fd);
-/* Deletes an FD from the fdsets.
- * The file descriptor is kept open.
- */
-void fd_remove(int fd);
-
/*
* Take over a FD belonging to another thread.
* Returns 0 on success, and -1 on failure.
/* Deletes an FD from the fdsets.
* The file descriptor is also closed.
*/
-static void fd_dodelete(int fd, int do_close)
+void fd_delete(int fd)
{
int locked = fdtab[fd].running_mask != tid_bit;
fdinfo[fd].port_range = NULL;
fdtab[fd].owner = NULL;
fdtab[fd].thread_mask = 0;
- if (do_close) {
- close(fd);
- _HA_ATOMIC_SUB(&ha_used_fds, 1);
- }
+ close(fd);
+ _HA_ATOMIC_SUB(&ha_used_fds, 1);
if (locked)
fd_clr_running(fd);
}
return ret;
}
-/* Deletes an FD from the fdsets.
- * The file descriptor is also closed.
- */
-void fd_delete(int fd)
-{
- fd_dodelete(fd, 1);
-}
-
-/* Deletes an FD from the fdsets.
- * The file descriptor is kept open.
- */
-void fd_remove(int fd)
-{
- fd_dodelete(fd, 0);
-}
-
void updt_fd_polling(const int fd)
{
if ((fdtab[fd].thread_mask & all_threads_mask) == tid_bit) {