summaryrefslogtreecommitdiff
path: root/ext/socket/basicsocket.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-08 03:25:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-08 03:25:50 +0000
commit51eaaa898b28321b185e15816cea6aaba592d732 (patch)
treeaaceb5a92ae56ee7d74ad12241f7f83f35427f69 /ext/socket/basicsocket.c
parent2deefdcd85ef5a75ed794c057d7b35e8e3ca1b3b (diff)
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
Diffstat (limited to 'ext/socket/basicsocket.c')
-rw-r--r--ext/socket/basicsocket.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c
index 3b6f22f..2937e31 100644
--- a/ext/socket/basicsocket.c
+++ b/ext/socket/basicsocket.c
@@ -532,6 +532,7 @@ rsock_bsock_send(int argc, VALUE *argv, VALUE sock)
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, VALUE sock)
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, VALUE sock)
if (rb_io_wait_writable(arg.fd)) {
continue;
}
- rb_sys_fail("send(2)");
+ rb_sys_fail(funcname);
}
return SSIZET2NUM(n);
}