Welcome to little lamb

Code » anopa » commit 3753fcf

start/stop: Fix possible warning re: longrun info

author Olivier Brunel
2017-01-24 17:53:04 UTC
committer Olivier Brunel
2017-06-18 12:26:49 UTC
parent c507feae33b39c7dee845e4de68adb2ab41901bd

start/stop: Fix possible warning re: longrun info

A warning "unable to get (update) longrun information" could be shown
for no reason, as since 2f0792ab when ftrigr_update() returns 0 (nothing
to do) aa_get_logfun_info() would wrongly return -1

src/libanopa/exec_longrun.c +4 -2

diff --git a/src/libanopa/exec_longrun.c b/src/libanopa/exec_longrun.c
index 39b783e..924271e 100644
--- a/src/libanopa/exec_longrun.c
+++ b/src/libanopa/exec_longrun.c
@@ -2,7 +2,7 @@
  * anopa - Copyright (C) 2015-2017 Olivier Brunel
  *
  * exec_longrun.c
- * Copyright (C) 2015-2016 Olivier Brunel <jjk@jjacky.com>
+ * Copyright (C) 2015-2017 Olivier Brunel <jjk@jjacky.com>
  *
  * This file is part of anopa.
  *
@@ -209,8 +209,10 @@ aa_get_longrun_info (uint16 *id, char *event)
     if (idx == -1)
     {
         r = ftrigr_update (&_aa_ft);
-        if (r <= 0)
+        if (r < 0)
             return -1;
+        else if (r == 0)
+            return 0;
         idx = 0;
     }