summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-26 22:18:03 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-26 22:18:03 +0000
commitda12c793c4c7ae60b50b944791ad057de86cb527 (patch)
tree3c45e8be84e4bf88c9a0432374434a121c2896f8 /ext
parent0e01d836df460ebf8b224e8b28d0e41dbacb65bc (diff)
* ext/socket/socket.c (sock_s_pack_sockaddr_un): support the longest
path in sockaddr_un, really. reported by nagachika. http://d.hatena.ne.jp/nagachika/20120426/ruby_trunk_changes_35474_35476 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 7830a14e26f..5a8bf077510 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1426,7 +1426,7 @@ sock_s_pack_sockaddr_un(VALUE self, VALUE path)
StringValue(path);
MEMZERO(&sockaddr, struct sockaddr_un, 1);
sockaddr.sun_family = AF_UNIX;
- if (sizeof(sockaddr.sun_path) <= (size_t)RSTRING_LEN(path)) {
+ if (sizeof(sockaddr.sun_path) < (size_t)RSTRING_LEN(path)) {
rb_raise(rb_eArgError, "too long unix socket path (%"PRIuSIZE" bytes given but %"PRIuSIZE" bytes max)",
(size_t)RSTRING_LEN(path), sizeof(sockaddr.sun_path));
}