Skip to content

Commit

Permalink
ext/socket: BasicSocket#shutdown(how) accepts symbol or string as how.
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Dec 17, 2011
1 parent efbe159 commit 7b43577
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ext/socket/socket.c
Expand Up @@ -359,11 +359,11 @@ bsock_shutdown(VALUE sock, SEL sel, int argc, VALUE *argv)
}
rb_scan_args(argc, argv, "01", &howto);
if (howto == Qnil)
how = 2;
how = SHUT_RDWR;
else {
how = NUM2INT(howto);
if (how < 0 || 2 < how) {
rb_raise(rb_eArgError, "`how' should be either 0, 1, 2");
how = shutdown_how_arg(howto);
if (how != SHUT_WR && how != SHUT_RD && how != SHUT_RDWR) {
rb_raise(rb_eArgError, "`how' should be either :SHUT_RD, :SHUT_WR, :SHUT_RDWR");
}
}
GetOpenFile(sock, fptr);
Expand Down

0 comments on commit 7b43577

Please sign in to comment.