aboutsummaryrefslogtreecommitdiffstats
path: root/ext/socket
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-17 02:36:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-17 02:36:28 +0000
commitc3bfb654ae7a1bf2b5bc4d3849bbdcb5e8293cbe (patch)
tree585713985991e8ebe2f4f7cb07e35c875a210a3e /ext/socket
parent37ce85765cf681083ab8841242e3816f6e70be82 (diff)
downloadruby-c3bfb654ae7a1bf2b5bc4d3849bbdcb5e8293cbe.tar.gz
socket/option.c: accurate condition
* ext/socket/option.c (inspect_tcpi_msec): more accurate condition for TCPI msec member inspection function. [ruby-core:74388] [Bug #12185] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/option.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/socket/option.c b/ext/socket/option.c
index 9fe21a12c1..7307548e50 100644
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -930,7 +930,12 @@ inspect_tcpi_usec(VALUE ret, const char *prefix, uint32_t t)
rb_str_catf(ret, "%s%u.%06us", prefix, t / 1000000, t % 1000000);
}
-#if defined(__linux__) || defined(__sun)
+#if !defined __FreeBSD__ && ( \
+ defined HAVE_STRUCT_TCP_INFO_TCPI_LAST_DATA_SENT || \
+ defined HAVE_STRUCT_TCP_INFO_TCPI_LAST_DATA_RECV || \
+ defined HAVE_STRUCT_TCP_INFO_TCPI_LAST_ACK_SENT || \
+ defined HAVE_STRUCT_TCP_INFO_TCPI_LAST_ACK_RECV || \
+ 0)
static void
inspect_tcpi_msec(VALUE ret, const char *prefix, uint32_t t)
{