about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-03-11 19:45:54 -0800
committerEric Wong <normalperson@yhbt.net>2011-03-11 19:48:10 -0800
commitfe2615590d5e8ac8e735200696ec8396fb3cd219 (patch)
tree02c4a3c53c74219fb780b1df9fa76977ea12cfff
parentf6cdffc3f8ba6dc276cff38c11d9f92aea1313ea (diff)
downloadraindrops-fe2615590d5e8ac8e735200696ec8396fb3cd219.tar.gz
64-bit counters are unnecessarily large for tracking
active or queued connections until we have IP_ROFLSCALE
support :>
-rw-r--r--ext/raindrops/linux_inet_diag.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/raindrops/linux_inet_diag.c b/ext/raindrops/linux_inet_diag.c
index 540c823..0eff08d 100644
--- a/ext/raindrops/linux_inet_diag.c
+++ b/ext/raindrops/linux_inet_diag.c
@@ -47,8 +47,8 @@ static unsigned g_seq;
 static VALUE cListenStats;
 
 struct listen_stats {
-        unsigned long active;
-        unsigned long queued;
+        uint32_t active;
+        uint32_t queued;
 };
 
 #define OPLEN (sizeof(struct inet_diag_bc_op) + \
@@ -63,8 +63,8 @@ struct nogvl_args {
 /* creates a Ruby ListenStats Struct based on our internal listen_stats */
 static VALUE rb_listen_stats(struct listen_stats *stats)
 {
-        VALUE active = ULONG2NUM(stats->active);
-        VALUE queued = ULONG2NUM(stats->queued);
+        VALUE active = UINT2NUM(stats->active);
+        VALUE queued = UINT2NUM(stats->queued);
 
         return rb_struct_new(cListenStats, active, queued);
 }