chiark / gitweb /
cgroup: don't trim a cgroup we create, we might just take it over from somebody else
[elogind.git] / src / label.c
index 218d0dfa06f119e34991f2bd4d281c163e5b9f9f..43f6e89fa5a1e22bdf30f39195c523ece3714f37 100644 (file)
@@ -65,7 +65,7 @@ int label_init(void) {
         return r;
 }
 
-int label_fix(const char *path) {
+int label_fix(const char *path, bool ignore_enoent) {
         int r = 0;
 
 #ifdef HAVE_SELINUX
@@ -94,6 +94,10 @@ int label_fix(const char *path) {
         }
 
         if (r < 0) {
+                /* Ignore ENOENT in some cases */
+                if (ignore_enoent && errno == ENOENT)
+                        return 0;
+
                 log_full(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG,
                          "Unable to fix label of %s: %m", path);
                 r = security_getenforce() == 1 ? -errno : 0;