]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/find.c
Update running status
[bacula/bacula] / bacula / src / findlib / find.c
index afc1097d25a9013a5564972a72f33c11dd94f2d1..17de805ee7b1dcbfcb3a26562e9683e92bcd9b97 100644 (file)
 #include "bacula.h"
 #include "find.h"
 
-/* Imported functions */
-int find_one_file(FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt), 
-              void *pkt, char *p, dev_t parent_device, int top_level);
-void term_find_one(FF_PKT *ff);
 
 size_t name_max;              /* filename max length */
 size_t path_max;              /* path name max length */
@@ -56,7 +52,6 @@ FF_PKT *init_find_files()
 
   init_include_exclude_files(ff);          /* init lists */
   ff->mtime_only = 1;
-  ff->one_file_system = 1;
 
    /* Get system path and filename maximum lengths */
    path_max = pathconf(".", _PC_PATH_MAX);
@@ -107,17 +102,17 @@ set_find_options(FF_PKT *ff, int incremental, time_t save_time)
  *
  */
 int
-find_files(FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt) 
+find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt) 
 {
    char *file;
    struct s_included_file *inc = NULL;
 
-   while ((inc = get_next_included_file(ff, inc))) {
+   while (!job_cancelled(jcr) && (inc = get_next_included_file(ff, inc))) {
       file = inc->fname;
       strcpy(ff->VerifyOpts, inc->VerifyOpts); /* Copy options for this file */
       Dmsg1(50, "find_files: file=%s\n", file);
       if (!file_is_excluded(ff, file)) {
-        if (!find_one_file(ff, callback, his_pkt, file, (dev_t)-1, 1)) {
+        if (!find_one_file(jcr, ff, callback, his_pkt, file, (dev_t)-1, 1)) {
            return 0;                  /* error return */
         }
       }
@@ -129,12 +124,14 @@ find_files(FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt)
  * Terminate find_files() and release
  * all allocated memory   
  */
-void
+int
 term_find_files(FF_PKT *ff)
 {
+  int hard_links;
+
   term_include_exclude_files(ff);
   free_pool_memory(ff->sys_fname);
-  term_find_one(ff);
+  hard_links = term_find_one(ff);
   free(ff);
-  return;
+  return hard_links;
 }