- Dmsg0(dbglvl, "Doing accurate hash on memory\n");
- pm_strcpy(jcr->hash_name, "*");
- pm_strcpy(temp, "*");
- }
-
- if(!tcadbopen(jcr->file_list, jcr->hash_name)){
- Jmsg(jcr, M_ERROR, 1, _("Can't open accurate hash disk\n"));
- Jmsg(jcr, M_INFO, 1, _("Disabling accurate mode\n"));
- tcadbdel(jcr->file_list);
- jcr->file_list = NULL;
- jcr->accurate = false;
- }
- free_pool_memory(temp);
- return jcr->file_list != NULL;
-}
-
-/* This function is called at the end of backup
- * We walk over all hash disk element, and we check
- * for elt.seen.
- */
-bool accurate_send_deleted_list(JCR *jcr)
-{
- char *key;
- CurFile *elt;
- int size;
- FF_PKT *ff_pkt;
- int stream = STREAM_UNIX_ATTRIBUTES;
-
- if (!jcr->accurate || jcr->JobLevel == L_FULL) {
- goto bail_out;
- }
-
- if (jcr->file_list == NULL) {
- goto bail_out;
- }
-
- ff_pkt = init_find_files();
- ff_pkt->type = FT_DELETED;
-
- /* traverse records */
- tcadbiterinit(jcr->file_list);
- while((key = tcadbiternext2(jcr->file_list)) != NULL) {
- elt = (CurFile *) tcadbget(jcr->file_list,
- key, strlen(key)+1, &size);
- if (elt)
- {
- if (!elt->seen) { /* already seen */
- ff_pkt->fname = key;
- ff_pkt->statp.st_mtime = elt->mtime;
- ff_pkt->statp.st_ctime = elt->ctime;
- encode_and_send_attributes(jcr, ff_pkt, stream);
- }
- realfree(elt);
- }
- realfree(key); /* tokyo cabinet have to use real free() */
- }
-
- term_find_files(ff_pkt);
-bail_out:
- /* TODO: clean htable when this function is not reached ? */
- if (jcr->file_list) {
- if(!tcadbclose(jcr->file_list)){
- Jmsg(jcr, M_ERROR, 1, _("Can't close accurate hash disk\n"));
- }
-
- /* delete the object */
- tcadbdel(jcr->file_list);
- if (!bstrcmp(jcr->hash_name, "*")) {
- unlink(jcr->hash_name);
- }
-
- free_pool_memory(jcr->hash_name);
- jcr->hash_name = NULL;
- jcr->file_list = NULL;