* ext/socket/socket.c (unix_recv_io): relax msg_controllen error

check.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-12-17 10:47:52 +00:00
Родитель 8ae0a40d02
Коммит 0a3a98aea4
2 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Wed Dec 17 19:39:44 2008 Tanaka Akira <akr@fsij.org>
* ext/socket/socket.c (unix_recv_io): relax msg_controllen error
check.
Wed Dec 17 19:37:30 2008 Tanaka Akira <akr@fsij.org>
* ext/pty/extconf.rb: check util.h for OpenBSD.

Просмотреть файл

@ -2118,9 +2118,14 @@ unix_recv_io(int argc, VALUE *argv, VALUE sock)
rb_sys_fail("recvmsg(2)");
#if FD_PASSING_BY_MSG_CONTROL
if (arg.msg.msg_controllen != CMSG_SPACE(sizeof(int))) {
if (arg.msg.msg_controllen < CMSG_LEN(sizeof(int))) {
rb_raise(rb_eSocket,
"file descriptor was not passed (msg_controllen=%d, %d expected)",
"file descriptor was not passed (msg_controllen=%d smaller than CMSG_LEN(sizeof(int))=%d)",
(int)arg.msg.msg_controllen, (int)CMSG_LEN(sizeof(int)));
}
if (CMSG_SPACE(sizeof(int)) < arg.msg.msg_controllen) {
rb_raise(rb_eSocket,
"file descriptor was not passed (msg_controllen=%d bigger than CMSG_SPACE(sizeof(int))=%d)",
(int)arg.msg.msg_controllen, (int)CMSG_SPACE(sizeof(int)));
}
if (cmsg.hdr.cmsg_len != CMSG_LEN(sizeof(int))) {