summaryrefslogtreecommitdiff
path: root/src/label.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-02-25 01:47:31 +0100
committerLennart Poettering <lennart@poettering.net>2011-02-25 01:47:31 +0100
commitc904f64d84db8c4eebedf210ba10893f19ba05ed (patch)
tree4c3d73acb9c6aa32d073107b8dd262a8c48a4334 /src/label.c
parent8e20e31a65ec9e637abf3821087946e9160001ac (diff)
label: udev might be making changes in /dev while we iterate through it
Also, there are most likely dead symlinks in there, so let's ignore ENOENT when we relabel. https://bugzilla.redhat.com/show_bug.cgi?id=680169
Diffstat (limited to 'src/label.c')
-rw-r--r--src/label.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/label.c b/src/label.c
index 218d0dfa06..09ded642fb 100644
--- a/src/label.c
+++ b/src/label.c
@@ -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
@@ -90,6 +90,10 @@ int label_fix(const char *path) {
/* If the FS doesn't support labels, then exit without warning */
if (r < 0 && errno == ENOTSUP)
return 0;
+
+ /* Ignore ENOENT in some cases */
+ if (r < 0 && ignore_enoent && errno == ENOENT)
+ return 0;
}
}