jcr->acl_text = get_pool_memory(PM_MESSAGE);
/* Subroutine save_file() is called for each file */
- if (!find_files(jcr, (FF_PKT *)jcr->ff, save_file, (void *)jcr)) {
+ if (!find_files(jcr, (FF_PKT *)jcr->ff, save_file)) {
ok = false; /* error */
set_jcr_job_status(jcr, JS_ErrorTerminated);
}
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2001-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2001-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
set_jcr_job_status(jcr, JS_Running);
set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime);
- stat = find_files(jcr, (FF_PKT *)jcr->ff, tally_file, (void *)jcr);
+ stat = find_files(jcr, (FF_PKT *)jcr->ff, tally_file);
return stat;
}
/* Checksum the entire file */
/* Make sure we don't modify JobBytes by saving and restoring it */
saved_bytes = jcr->JobBytes;
- if (find_one_file(jcr, jcr->ff, do_file_digest, jcr, jcr->last_fname, (dev_t)-1, 1) != 0) {
+ if (find_one_file(jcr, jcr->ff, do_file_digest, jcr->last_fname, (dev_t)-1, 1) != 0) {
Jmsg(jcr, M_ERROR, 0, _("Digest one file failed for file: %s\n"),
jcr->last_fname);
jcr->JobBytes = saved_bytes;
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime);
Dmsg0(10, "Start find files\n");
/* Subroutine verify_file() is called for each file */
- find_files(jcr, (FF_PKT *)jcr->ff, verify_file, (void *)jcr);
+ find_files(jcr, (FF_PKT *)jcr->ff, verify_file);
Dmsg0(10, "End find files\n");
if (jcr->big_buf) {
*
*/
int
-find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool top_level),
- void *his_pkt)
+find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool top_level))
{
ff->callback = callback;
char *fname = node->c_str();
Dmsg1(100, "F %s\n", fname);
ff->top_fname = fname;
- if (find_one_file(jcr, ff, our_callback, his_pkt, ff->top_fname, (dev_t)-1, true) == 0) {
+ if (find_one_file(jcr, ff, our_callback, ff->top_fname, (dev_t)-1, true) == 0) {
return 0; /* error return */
}
}
int
find_one_file(JCR *jcr, FF_PKT *ff_pkt,
int handle_file(FF_PKT *ff, void *hpkt, bool top_level),
- void *pkt, char *fname, dev_t parent_device, bool top_level)
+ char *fname, dev_t parent_device, bool top_level)
{
struct utimbuf restore_times;
int rtn_stat;
/* Cannot stat file */
ff_pkt->type = FT_NOSTAT;
ff_pkt->ff_errno = errno;
- return handle_file(ff_pkt, pkt, top_level);
+ return handle_file(ff_pkt, jcr, top_level);
}
Dmsg1(300, "File ----: %s\n", fname);
ff_pkt->statp.st_ctime < ff_pkt->save_time)) {
/* Incremental option, file not changed */
ff_pkt->type = FT_NOCHG;
- return handle_file(ff_pkt, pkt, top_level);
+ return handle_file(ff_pkt, jcr, top_level);
}
}
sizeof(ff_pkt->hfsinfo), FSOPT_NOFOLLOW) != 0) {
ff_pkt->type = FT_NOSTAT;
ff_pkt->ff_errno = errno;
- return handle_file(ff_pkt, pkt, top_level);
+ return handle_file(ff_pkt, jcr, top_level);
}
}
#endif
ff_pkt->link = lp->name;
ff_pkt->type = FT_LNKSAVED; /* Handle link, file already saved */
ff_pkt->LinkFI = lp->FileIndex;
- return handle_file(ff_pkt, pkt, top_level);
+ return handle_file(ff_pkt, jcr, top_level);
}
/* File not previously dumped. Chain it into our list. */
} else {
ff_pkt->type = FT_REG;
}
- rtn_stat = handle_file(ff_pkt, pkt, top_level);
+ rtn_stat = handle_file(ff_pkt, jcr, top_level);
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
}
/* Could not follow link */
ff_pkt->type = FT_NOFOLLOW;
ff_pkt->ff_errno = errno;
- rtn_stat = handle_file(ff_pkt, pkt, top_level);
+ rtn_stat = handle_file(ff_pkt, jcr, top_level);
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
}
buffer[size] = 0;
ff_pkt->link = buffer; /* point to link */
ff_pkt->type = FT_LNK; /* got a real link */
- rtn_stat = handle_file(ff_pkt, pkt, top_level);
+ rtn_stat = handle_file(ff_pkt, jcr, top_level);
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
}
/* Could not access() directory */
ff_pkt->type = FT_NOACCESS;
ff_pkt->ff_errno = errno;
- rtn_stat = handle_file(ff_pkt, pkt, top_level);
+ rtn_stat = handle_file(ff_pkt, jcr, top_level);
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
}
* do not immediately save it, but do so only after everything
* in the directory is seen (i.e. the FT_DIREND).
*/
- rtn_stat = handle_file(ff_pkt, pkt, top_level);
+ rtn_stat = handle_file(ff_pkt, jcr, top_level);
if (rtn_stat < 1 || ff_pkt->type == FT_REPARSE) { /* ignore or error status */
free(link);
return rtn_stat;
}
/* If not recursing, just backup dir and return */
if (!recurse) {
- rtn_stat = handle_file(ff_pkt, pkt, top_level);
+ rtn_stat = handle_file(ff_pkt, jcr, top_level);
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
}
if ((directory = opendir(fname)) == NULL) {
ff_pkt->type = FT_NOOPEN;
ff_pkt->ff_errno = errno;
- rtn_stat = handle_file(ff_pkt, pkt, top_level);
+ rtn_stat = handle_file(ff_pkt, jcr, top_level);
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
}
}
*q = 0;
if (!file_is_excluded(ff_pkt, link)) {
- rtn_stat = find_one_file(jcr, ff_pkt, handle_file, pkt, link, our_device, false);
+ rtn_stat = find_one_file(jcr, ff_pkt, handle_file, link, our_device, false);
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
}
* the directory modes and dates. Temp directory values
* were used without this record.
*/
- handle_file(dir_ff_pkt, pkt, top_level); /* handle directory entry */
+ handle_file(dir_ff_pkt, jcr, top_level); /* handle directory entry */
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = dir_ff_pkt->FileIndex;
}
/* The only remaining types are special (character, ...) files */
ff_pkt->type = FT_SPEC;
}
- rtn_stat = handle_file(ff_pkt, pkt, top_level);
+ rtn_stat = handle_file(ff_pkt, jcr, top_level);
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
}
int
-match_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool), void *his_pkt)
+match_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool))
{
ff->callback = callback;
bstrncat(ff->VerifyOpts, inc->VerifyOpts, sizeof(ff->VerifyOpts));
Dmsg1(100, "find_files: file=%s\n", inc->fname);
if (!file_is_excluded(ff, inc->fname)) {
- if (find_one_file(jcr, ff, callback, his_pkt, inc->fname, (dev_t)-1, 1) ==0) {
+ if (find_one_file(jcr, ff, callback, inc->fname, (dev_t)-1, 1) ==0) {
return 0; /* error return */
}
}
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
/* From find.c */
FF_PKT *init_find_files();
void set_find_options(FF_PKT *ff, int incremental, time_t mtime);
-int find_files(JCR *jcr, FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt, bool), void *pkt);
-int match_files(JCR *jcr, FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt, bool), void *pkt);
+int find_files(JCR *jcr, FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt, bool));
+int match_files(JCR *jcr, FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt, bool));
int term_find_files(FF_PKT *ff);
int get_win32_driveletters(FF_PKT *ff, char* szDrives);
/* From find_one.c */
int find_one_file(JCR *jcr, FF_PKT *ff,
int handle_file(FF_PKT *ff_pkt, void *hpkt, bool top_level),
- void *pkt, char *p, dev_t parent_device, bool top_level);
+ char *p, dev_t parent_device, bool top_level);
int term_find_one(FF_PKT *ff);
bool has_file_changed(JCR *jcr, FF_PKT *ff_pkt);
copy_fileset(ff, jcr);
- find_files(jcr, ff, print_file, NULL);
+ find_files(jcr, ff, print_file);
free_jcr(jcr);
free_config_resources();
}
fclose(fd);
}
- match_files(jcr, ff, print_file, NULL);
+ match_files(jcr, ff, print_file);
term_include_exclude_files(ff);
hard_links = term_find_files(ff);
#undef VERSION
#define VERSION "2.3.9"
-#define BDATE "08 February 2008"
-#define LSMDATE "08Feb08"
+#define BDATE "09 February 2008"
+#define LSMDATE "09Feb08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
General:
09Feb08
+kes Remove a redundant jcr argument to find_files, match_files, and
+ find_one_file.
kes Implement '.status dir header|scheduled|running|terminated' that
prints the requested status section. With the exception of the
header, the other reports have fields separated by tabs (\t).