summaryrefslogtreecommitdiff
path: root/ext/socket/ancdata.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-30 08:19:37 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-30 08:19:37 +0000
commit5e3455597d25dff31582254dc0d220ccdd2b8b98 (patch)
tree099119931225c2838b3adcd6903083688add46f1 /ext/socket/ancdata.c
parentc1f355d91ff21f79c8d8c22d43581ac1a157c609 (diff)
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/socket/ancdata.c')
-rw-r--r--ext/socket/ancdata.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 0a94149..ef6a870 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);
}