summaryrefslogtreecommitdiff
path: root/ext/socket/option.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-09 13:56:43 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-09 13:56:43 +0000
commitf5da7031b91426f362e8ec2101bf794976ecc590 (patch)
tree4d360cb11fc6daa19f831c1a30baecad4351515a /ext/socket/option.c
parent2092fbcc3ad4437f066dc79a64a80236afcbdf50 (diff)
* ext/socket/rubysocket.h (level_arg): add family argument.
(optname_arg): ditto. (cmsg_type_arg): ditto. (rb_sock_getfamily): declared. * ext/socket/constants.c (level_arg): add family argument. (optname_arg): ditto. (cmsg_type_arg): ditto. * ext/socket/init.c (rb_sock_getfamily): defined. * ext/socket/option.c (sockopt_initialize): give family for level_arg and optname_arg. (sockopt_s_int): ditto. * ext/socket/basicsocket.c (bsock_setsockopt): ditto. (bsock_getsockopt): ditto. * ext/socket/ancdata.c (ancillary_initialize): ditto. (ancillary_s_int): ditto. (ancillary_cmsg_is_p): ditto. (bsock_sendmsg_internal): ditto. (bsock_recvmsg_internal): use rb_sock_getfamily. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/option.c')
-rw-r--r--ext/socket/option.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/socket/option.c b/ext/socket/option.c
index 900b99a..e09cb79 100644
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -38,8 +38,8 @@ static VALUE
sockopt_initialize(VALUE self, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE data)
{
int family = family_arg(vfamily);
- int level = level_arg(vlevel);
- int optname = optname_arg(level, voptname);
+ int level = level_arg(family, vlevel);
+ int optname = optname_arg(family, level, voptname);
StringValue(data);
rb_ivar_set(self, rb_intern("family"), INT2NUM(family));
rb_ivar_set(self, rb_intern("level"), INT2NUM(level));
@@ -133,8 +133,8 @@ static VALUE
sockopt_s_int(VALUE klass, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE vint)
{
int family = family_arg(vfamily);
- int level = level_arg(vlevel);
- int optname = optname_arg(level, voptname);
+ int level = level_arg(family, vlevel);
+ int optname = optname_arg(family, level, voptname);
int i = NUM2INT(vint);
return sockopt_new(family, level, optname, rb_str_new((char*)&i, sizeof(i)));
}