Welcome to little lamb

Code » anopa » commit 2f0792a

start/stop: Tweak warning message

author Olivier Brunel
2016-01-09 14:55:31 UTC
committer Olivier Brunel
2016-01-09 14:55:31 UTC
parent 9080ed3d40cef22b62c650a396bf201e49007251

start/stop: Tweak warning message

src/anopa/start-stop.c +3 -1
src/libanopa/exec_longrun.c +2 -2

diff --git a/src/anopa/start-stop.c b/src/anopa/start-stop.c
index e3c1c50..7dc5ce1 100644
--- a/src/anopa/start-stop.c
+++ b/src/anopa/start-stop.c
@@ -1312,7 +1312,9 @@ mainloop (aa_mode mode, aa_scan_cb scan_cb)
                     r = aa_get_longrun_info (&id, &event);
                     if (r < 0)
                     {
-                        aa_strerr_warnu1sys ("get longrun information");
+                        aa_strerr_warnu3sys ("get (",
+                                (r == -1) ? "update" : "check",
+                                ") longrun information");
                         break;
                     }
                     else if (r == 0)
diff --git a/src/libanopa/exec_longrun.c b/src/libanopa/exec_longrun.c
index 5fc1303..482120a 100644
--- a/src/libanopa/exec_longrun.c
+++ b/src/libanopa/exec_longrun.c
@@ -209,7 +209,7 @@ aa_get_longrun_info (uint16 *id, char *event)
     {
         r = ftrigr_update (&_aa_ft);
         if (r <= 0)
-            return r;
+            return -1;
         i = 0;
     }
 
@@ -219,7 +219,7 @@ aa_get_longrun_info (uint16 *id, char *event)
         r = ftrigr_check (&_aa_ft, *id, event);
         ++i;
         if (r != 0)
-            return r;
+            return (r < 0) ? -2 : r;
     }
 
     i = -1;