basicsocket.c: proper system call name
* ext/socket/basicsocket.c (rsock_bsock_send): show proper system call name in the exception message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2deefdcd85
commit
51eaaa898b
@ -532,6 +532,7 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
|
|||||||
rb_io_t *fptr;
|
rb_io_t *fptr;
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
rb_blocking_function_t *func;
|
rb_blocking_function_t *func;
|
||||||
|
const char *funcname;
|
||||||
|
|
||||||
rb_scan_args(argc, argv, "21", &arg.mesg, &flags, &to);
|
rb_scan_args(argc, argv, "21", &arg.mesg, &flags, &to);
|
||||||
|
|
||||||
@ -542,9 +543,11 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
|
|||||||
arg.to = (struct sockaddr *)RSTRING_PTR(to);
|
arg.to = (struct sockaddr *)RSTRING_PTR(to);
|
||||||
arg.tolen = RSTRING_SOCKLEN(to);
|
arg.tolen = RSTRING_SOCKLEN(to);
|
||||||
func = rsock_sendto_blocking;
|
func = rsock_sendto_blocking;
|
||||||
|
funcname = "sendto(2)";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
func = rsock_send_blocking;
|
func = rsock_send_blocking;
|
||||||
|
funcname = "send(2)";
|
||||||
}
|
}
|
||||||
GetOpenFile(sock, fptr);
|
GetOpenFile(sock, fptr);
|
||||||
arg.fd = fptr->fd;
|
arg.fd = fptr->fd;
|
||||||
@ -554,7 +557,7 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
|
|||||||
if (rb_io_wait_writable(arg.fd)) {
|
if (rb_io_wait_writable(arg.fd)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
rb_sys_fail("send(2)");
|
rb_sys_fail(funcname);
|
||||||
}
|
}
|
||||||
return SSIZET2NUM(n);
|
return SSIZET2NUM(n);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user