return sendmsg(handle, &msg, 0);
}
-#ifdef __osf__
-# define CHECK_MSG(msg) TRUE /* Tru64 */
-#else
-# define CHECK_MSG(msg) ((msg).msg_controllen >= CMSG_SPACE(sizeof(int)))
-#endif
-
#ifdef LINUX20
/* Linux 2.0.x doesn't set any cmsg fields. Note that this might make some
attacks possible so don't do it unless you really have to. */
/* at least one byte transferred - we should have the fd now.
do extra checks to make sure it really is an fd that is being
transferred to avoid potential DoS conditions. some systems don't
- set all these values correctly however so CHECK_MSG() and
- CHECK_CMSG() are somewhat system dependent */
+ set all these values correctly however so CHECK_CMSG() is somewhat
+ system dependent */
cmsg = CMSG_FIRSTHDR(&msg);
- if (!CHECK_MSG(msg) || !CHECK_CMSG(cmsg))
+ if (!CHECK_CMSG(cmsg))
*fd = -1;
else
memcpy(fd, CMSG_DATA(cmsg), sizeof(*fd));