Improvement of tagging directories. 85/26985/7
authorJosé Bollo <jose.bollo@open.eurogiciel.org>
Tue, 2 Sep 2014 13:11:55 +0000 (15:11 +0200)
committerRafal Krypa <r.krypa@samsung.com>
Mon, 20 Oct 2014 15:28:27 +0000 (08:28 -0700)
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 <jose.bollo@open.eurogiciel.org>
src/server/service/smack-labels.cpp

index 040cf70..ff447eb 100644 (file)
@@ -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.");