From 508c39b2aac0abf6df4d3a6336bb1c794c303d38 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 2 Jun 2007 17:46:51 +0000 Subject: [PATCH] Port queries only support 'eq' --- bindings/java/src/org/hyperic/sigar/test/TestPTQL.java | 1 + src/sigar_ptql.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/bindings/java/src/org/hyperic/sigar/test/TestPTQL.java b/bindings/java/src/org/hyperic/sigar/test/TestPTQL.java index d0bc90b8..009a901f 100644 --- a/bindings/java/src/org/hyperic/sigar/test/TestPTQL.java +++ b/bindings/java/src/org/hyperic/sigar/test/TestPTQL.java @@ -100,6 +100,7 @@ public class TestPTQL extends SigarTestCase { "Pid.Pid.eq=foo", "Cpu.Percent.ge=x", "Port.foo.eq=8080", + "Port.tcp.gt=8080", "", null, //disabled for testing w/ -Dsigar.ptql.native=true diff --git a/src/sigar_ptql.c b/src/sigar_ptql.c index ec333b84..409a8a56 100644 --- a/src/sigar_ptql.c +++ b/src/sigar_ptql.c @@ -856,6 +856,11 @@ static int ptql_env_match(sigar_t *sigar, static int ptql_branch_init_port(ptql_parse_branch_t *parsed, ptql_branch_t *branch) { + /* only 'eq' is supported here */ + if (branch->op_name != PTQL_OP_EQ) { + return SIGAR_PTQL_MALFORMED_QUERY; + } + if (strEQ(parsed->attr, "tcp")) { branch->flags = SIGAR_NETCONN_TCP; }