From cdca4e19d0274e86e128ae9dc61291fb13b18763 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 22 Feb 2009 17:10:47 +0000 Subject: [PATCH] * ext/socket/option.c (inspect_timeval): fix the size test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ ext/socket/option.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 74c9650bc8..bed462768b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Feb 23 02:10:09 2009 Tanaka Akira + + * ext/socket/option.c (inspect_timeval): fix the size test. + Sun Feb 22 22:42:20 2009 Nobuyoshi Nakada * string.c (tr_trans): should recalculate coderange. diff --git a/ext/socket/option.c b/ext/socket/option.c index 5563a7d8bb..7d62d73ff5 100644 --- a/ext/socket/option.c +++ b/ext/socket/option.c @@ -305,7 +305,7 @@ inspect_socktype(int level, int optname, VALUE data, VALUE ret) static int inspect_timeval(int level, int optname, VALUE data, VALUE ret) { - if (RSTRING_LEN(data) == sizeof(struct linger)) { + if (RSTRING_LEN(data) == sizeof(struct timeval)) { struct timeval s; memcpy((char*)&s, RSTRING_PTR(data), sizeof(s)); rb_str_catf(ret, " %ld.%06ldsec", (long)s.tv_sec, (long)s.tv_usec);