зеркало из https://github.com/github/ruby.git
* ext/socket/ancdata.c (nogvl_recvmsg_func): use MSG_CMSG_CLOEXEC if
available. * ext/socket/unixsocket.c (recvmsg_blocking): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ee5ae134dd
Коммит
7ae60a6b0d
|
@ -1,3 +1,10 @@
|
|||
Tue Nov 1 07:31:55 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/ancdata.c (nogvl_recvmsg_func): use MSG_CMSG_CLOEXEC if
|
||||
available.
|
||||
|
||||
* ext/socket/unixsocket.c (recvmsg_blocking): ditto.
|
||||
|
||||
Tue Nov 1 05:59:41 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/socket/socket.c (rsock_socketpair): use SOCK_CLOEXEC if
|
||||
|
|
|
@ -1362,7 +1362,12 @@ static VALUE
|
|||
nogvl_recvmsg_func(void *ptr)
|
||||
{
|
||||
struct recvmsg_args_struct *args = ptr;
|
||||
return recvmsg(args->fd, args->msg, args->flags);
|
||||
int flags = args->flags;
|
||||
#ifdef MSG_CMSG_CLOEXEC
|
||||
/* MSG_CMSG_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */
|
||||
flags |= MSG_CMSG_CLOEXEC;
|
||||
#endif
|
||||
return recvmsg(args->fd, args->msg, flags);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
|
|
@ -264,7 +264,12 @@ static VALUE
|
|||
recvmsg_blocking(void *data)
|
||||
{
|
||||
struct iomsg_arg *arg = data;
|
||||
return recvmsg(arg->fd, &arg->msg, 0);
|
||||
int flags = 0;
|
||||
#ifdef MSG_CMSG_CLOEXEC
|
||||
/* MSG_CMSG_CLOEXEC is available since Linux 2.6.23. Linux 2.6.18 silently ignore it. */
|
||||
flags |= MSG_CMSG_CLOEXEC;
|
||||
#endif
|
||||
return recvmsg(arg->fd, &arg->msg, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче