From 192eb07965994e541d0b6f8da1137328e9a1607b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Tue, 2 Sep 2014 15:11:55 +0200 Subject: [PATCH] Improvement of tagging directories. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The directories are visited two times: in pre-order and post-order. Here to avoid tagging at both times we choose to simply tag in post-order (that is for simplicity of the code. Change-Id: I866481471d433036ca371035c74e583b3a9dcfda Signed-off-by: José Bollo --- src/server/service/smack-labels.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/service/smack-labels.cpp b/src/server/service/smack-labels.cpp index 040cf70..ff447eb 100644 --- a/src/server/service/smack-labels.cpp +++ b/src/server/service/smack-labels.cpp @@ -125,6 +125,10 @@ static bool dirSetSmack(const std::string &path, const std::string &label, return false; } + /* avoid to tag directories two times */ + if (ftsent->fts_info == FTS_D) + continue; + ret = fn(ftsent); if (ret == FileDecision::ERROR) { LogError("fn(ftsent) failed."); -- 2.7.4