summaryrefslogtreecommitdiff
path: root/src/sysdeps/tryancilautoclose.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2014-12-20 23:15:16 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2014-12-20 23:15:16 +0000
commit828159d33b8ced9e016470c61ffd66bbef048e06 (patch)
tree5c739a3ffc9001b34730c1a08334e3524f081dd2 /src/sysdeps/tryancilautoclose.c
parent7c925e3e76d239b8cca5a31ddd045aad10190e8a (diff)
downloadskalibs-828159d33b8ced9e016470c61ffd66bbef048e06.tar.xz
Something is rotten in the state of FreeBSD... but we all knew it
already. More tentative workarounds.
Diffstat (limited to 'src/sysdeps/tryancilautoclose.c')
-rw-r--r--src/sysdeps/tryancilautoclose.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sysdeps/tryancilautoclose.c b/src/sysdeps/tryancilautoclose.c
index c58e3b8..53b768d 100644
--- a/src/sysdeps/tryancilautoclose.c
+++ b/src/sysdeps/tryancilautoclose.c
@@ -48,7 +48,8 @@ static int ancil_send_fd (int sock, int fd)
cmsg->cmsg_level = SOL_SOCKET ;
cmsg->cmsg_type = SCM_RIGHTS ;
*((int *)CMSG_DATA(cmsg)) = fd ;
- return (sendmsg(sock, &msghdr, 0) >= 0) ;
+ if (sendmsg(sock, &msghdr, 0) < 0) return 0 ;
+ return 1 ;
}
static int ancil_recv_fd (int sock)