diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-30 08:19:37 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-30 08:19:37 +0000 |
commit | 5e3455597d25dff31582254dc0d220ccdd2b8b98 (patch) | |
tree | 099119931225c2838b3adcd6903083688add46f1 /ext | |
parent | c1f355d91ff21f79c8d8c22d43581ac1a157c609 (diff) | |
download | ruby-5e3455597d25dff31582254dc0d220ccdd2b8b98.tar.gz |
ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile
See doc/extension.rdoc for explanation.
[ruby-core:69419] [Feature #11198]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/socket/ancdata.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index 0a94149b08..ef6a870fa2 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -1135,7 +1135,7 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock) struct msghdr mh; struct iovec iov; #if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL) - volatile VALUE controls_str = 0; + VALUE controls_str = 0; VALUE *controls_ptr = NULL; int family; #endif @@ -1291,6 +1291,9 @@ bsock_sendmsg_internal(int argc, VALUE *argv, VALUE sock, int nonblock) rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "sendmsg(2) would block"); rb_sys_fail("sendmsg(2)"); } +#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL) + RB_GC_GUARD(controls_str); +#endif return SSIZET2NUM(ss); } |