Welcome to little lamb

Code » anopa » commit 1ec37b3

Fix not always reporting an error when loading a service

author Olivier Brunel
2015-10-16 13:04:12 UTC
committer Olivier Brunel
2015-10-16 18:17:11 UTC
parent f8db66e23fdfebbdf909fde39400dcaa9f7ef1c4

Fix not always reporting an error when loading a service

This could manifest e.g. when aa-status couldn't read the s6 status file
(permission denied), and would just silently ignore the error/service.

src/libanopa/service.c +6 -0

diff --git a/src/libanopa/service.c b/src/libanopa/service.c
index 83a053c..68b9613 100644
--- a/src/libanopa/service.c
+++ b/src/libanopa/service.c
@@ -249,6 +249,12 @@ aa_ensure_service_loaded (int si, aa_mode mode, int no_wants, aa_load_fail_cb lf
                 chk_st = 0;
                 is_up = st6.pid && !st6.flagfinishing;
             }
+            else if (errno != ENOENT)
+            {
+                /* most likely a permission error on supervise folder */
+                r = -ERR_IO;
+                goto err;
+            }
             tain_now_g ();
         }