From c2e99ad0fbca5f669c76f188cff7e74681a3e683 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 2 Feb 2016 23:33:34 +0000 Subject: Tentative re-commit of the closecb feature --- src/libunixonacid/unixmessage_sender_flush.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libunixonacid/unixmessage_sender_flush.c') diff --git a/src/libunixonacid/unixmessage_sender_flush.c b/src/libunixonacid/unixmessage_sender_flush.c index 75412fb..6559083 100644 --- a/src/libunixonacid/unixmessage_sender_flush.c +++ b/src/libunixonacid/unixmessage_sender_flush.c @@ -97,13 +97,13 @@ int unixmessage_sender_flush (unixmessage_sender_t *b) while (r < 0 && errno == EINTR) ; if (r <= 0) return 0 ; #ifndef SKALIBS_HASANCILAUTOCLOSE - if (nfds) + if (nfds && b->closecb) { register unsigned int i = 0 ; for (; i < nfds ; i++) { register int fd = genalloc_s(int, &b->fds)[offsets[b->head].right + i] ; - if (fd < 0) fd_close(-(fd+1)) ; + if (fd < 0) (*b->closecb)(-(fd+1), b->closecbdata) ; } } #endif -- cgit v1.2.3