From 0b38c6455da1ec2ebd10405c510b53428ba278f5 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sun, 23 Sep 2007 23:49:29 +0000 Subject: [PATCH] fix net_services_name retval --- bindings/ruby/examples/netstat.rb | 2 +- bindings/ruby/rbsigar.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/ruby/examples/netstat.rb b/bindings/ruby/examples/netstat.rb index cc820756..9903f281 100644 --- a/bindings/ruby/examples/netstat.rb +++ b/bindings/ruby/examples/netstat.rb @@ -14,7 +14,7 @@ def format_port(sigar, proto, port, is_numeric) end if !is_numeric service = sigar.net_services_name(proto, port) - if service != false + if service != nil return service end end diff --git a/bindings/ruby/rbsigar.c b/bindings/ruby/rbsigar.c index ed462c64..56491cbb 100644 --- a/bindings/ruby/rbsigar.c +++ b/bindings/ruby/rbsigar.c @@ -212,7 +212,7 @@ static VALUE rb_sigar_net_services_name(VALUE obj, VALUE protocol, VALUE port) return rb_str_new2(name); } else { - Qnil; + return Qnil; } }