passfd: speed up configure and drop unused code
authorEric Blake <eblake@redhat.com>
Thu, 21 Apr 2011 17:48:22 +0000 (11:48 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 21 Apr 2011 20:35:52 +0000 (14:35 -0600)
commite55355319eb5409871be533d7b9713328a8283db
treeaffc1bab1253735ca8ddff892b9b7b1ef99db42b
parent06d76f63c628cb1653f3c27a1f60a46cf44665ba
passfd: speed up configure and drop unused code

Ultimately, it would be nice to provide a sendmsg and recvmsg module,
and have those provide a replacement struct msghdr and silently
convert msg_accrights into the replacement struct's msg_control, when
targeting older BSD.  But until that point in time, this is a nice
cleanup.

SCM_RIGHTS really only works on Unix sockets; however, there is
nothing in passfd.c that needs to be hard-coded to this (rather,
the hard-coding of the address family is done externally when
the socket or socketpair is created).

* m4/afunix.m4 (gl_SOCKET_AFUNIX): Rename...
* m4/passfd.m4 (gl_PASSFD): ...to something more fitting of
its use.  Drop test for setting unused HAVE_UNIXSOCKET_SCM_RIGHTS.
Instead of probing at configure for unix_scm_rights_bsd44_way,
instead probe for CMSG_FIRSTHDR at compile time.  Simplify BSD 4.3
check to a struct member probe.
* lib/passfd.c (includes): Nothing here requires <sys/un.h>.
(sendfd, recvfd): Update preprocessor checks.
* modules/passfd (Files): Reflect rename, and drop unused file.
(Depends-on): Drop unused dependency.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/passfd.c
m4/afunix.m4 [deleted file]
m4/passfd.m4 [new file with mode: 0644]
modules/passfd