1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/socket.c (sock_s_socketpair): make 3rd argument optional.

* ext/socket/unixsocket.c (unix_s_socketpair): follow the above
  change.

* ext/socket/rubysocket.h (sock_s_socketpair): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-02-04 16:20:05 +00:00
parent 1934c7a80b
commit 5ce10c1359
4 changed files with 24 additions and 5 deletions

View file

@ -463,6 +463,7 @@ unix_s_socketpair(int argc, VALUE *argv, VALUE klass)
{
VALUE domain, type, protocol;
domain = INT2FIX(PF_UNIX);
VALUE args[3];
rb_scan_args(argc, argv, "02", &type, &protocol);
if (argc == 0)
@ -470,7 +471,11 @@ unix_s_socketpair(int argc, VALUE *argv, VALUE klass)
if (argc <= 1)
protocol = INT2FIX(0);
return sock_s_socketpair(klass, domain, type, protocol);
args[0] = domain;
args[1] = type;
args[2] = protocol;
return sock_s_socketpair(3, args, klass);
}
#endif