ruby-changes:46164
From: nobu <ko1@a...>
Date: Sat, 8 Apr 2017 12:25:56 +0900 (JST)
Subject: [ruby-changes:46164] nobu:r58277 (trunk): basicsocket.c: proper system call name
nobu 2017-04-08 12:25:50 +0900 (Sat, 08 Apr 2017) New Revision: 58277 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58277 Log: basicsocket.c: proper system call name * ext/socket/basicsocket.c (rsock_bsock_send): show proper system call name in the exception message. Modified files: trunk/ext/socket/basicsocket.c Index: ext/socket/basicsocket.c =================================================================== --- ext/socket/basicsocket.c (revision 58276) +++ ext/socket/basicsocket.c (revision 58277) @@ -532,6 +532,7 @@ rsock_bsock_send(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/ext/socket/basicsocket.c#L532 rb_io_t *fptr; ssize_t n; rb_blocking_function_t *func; + const char *funcname; rb_scan_args(argc, argv, "21", &arg.mesg, &flags, &to); @@ -542,9 +543,11 @@ rsock_bsock_send(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/ext/socket/basicsocket.c#L543 arg.to = (struct sockaddr *)RSTRING_PTR(to); arg.tolen = RSTRING_SOCKLEN(to); func = rsock_sendto_blocking; + funcname = "sendto(2)"; } else { func = rsock_send_blocking; + funcname = "send(2)"; } GetOpenFile(sock, fptr); arg.fd = fptr->fd; @@ -554,7 +557,7 @@ rsock_bsock_send(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/ext/socket/basicsocket.c#L557 if (rb_io_wait_writable(arg.fd)) { continue; } - rb_sys_fail("send(2)"); + rb_sys_fail(funcname); } return SSIZET2NUM(n); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/