]> arthur.barton.de Git - netatalk.git/commitdiff
Try to remove non existent files from the Tracker index
authorRalph Boehme <sloowfranklin@gmail.com>
Wed, 27 Feb 2013 15:59:14 +0000 (16:59 +0100)
committerRalph Boehme <sloowfranklin@gmail.com>
Wed, 27 Feb 2013 15:59:14 +0000 (16:59 +0100)
etc/spotlight/slmod_rdf.c

index 6863a349ffea59e0f31b02b801fbea4e72d25809..81abdcf5511887484df5cececccb650b43fc7b41 100644 (file)
@@ -193,6 +193,13 @@ static int sl_mod_fetch_result(void *p)
                 firstmatch = false;
             }
 
+            struct stat st;
+            if (stat(respath, &st) != 0) {
+                if (errno == ENOENT)
+                    tracker_files_delete(client, respath, NULL);
+                goto loop_continue;
+            }
+
             if ((id = cnid_for_path(slq->slq_vol->v_cdb, slq->slq_vol->v_path, respath, &did)) == CNID_INVALID) {
                 LOG(log_error, logtype_sl, "sl_mod_fetch_result: cnid_for_path error: %s", respath);
                 goto loop_continue;