]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/bscan.c
Correct usage of MTIOCLRERR ioctl for clearing persistant errors
[bacula/bacula] / bacula / src / stored / bscan.c
index 7c686ac7f680758f120c58f57217ad9375c9ff0f..69482f198eaaa2a088d51108ab8569c72614d7a6 100644 (file)
@@ -129,7 +129,7 @@ PROG_COPYRIGHT
 "       -v                verbose\n"
 "       -V <Volumes>      specify Volume names (separated by |)\n"
 "       -w <dir>          specify working directory (default from conf file)\n"
-"       -?                print this message\n\n"), BYEAR, VERSION, BDATE);
+"       -?                print this message\n\n"), 2001, VERSION, BDATE);
    exit(1);
 }
 
@@ -147,6 +147,7 @@ int main (int argc, char *argv[])
    my_name_is(argc, argv, "bscan");
    init_msg(NULL, NULL);
 
+   OSDependentInit();
 
    while ((ch = getopt(argc, argv, "b:c:d:h:mn:pP:rsSu:vV:w:?")) != -1) {
       switch (ch) {
@@ -269,7 +270,7 @@ int main (int argc, char *argv[])
    if (showProgress) {
       char ed1[50];
       struct stat sb;
-      fstat(dev->fd, &sb);
+      fstat(dev->fd(), &sb);
       currentVolumeSize = sb.st_size;
       Pmsg1(000, _("First Volume Size = %sn"), 
          edit_uint64(currentVolumeSize, ed1));
@@ -342,7 +343,7 @@ static bool bscan_mount_next_read_volume(DCR *dcr)
    if (showProgress) {
       char ed1[50];
       struct stat sb;
-      fstat(dev->fd, &sb);
+      fstat(dev->fd(), &sb);
       currentVolumeSize = sb.st_size;
       Pmsg1(000, _("First Volume Size = %sn"), 
          edit_uint64(currentVolumeSize, ed1));
@@ -365,6 +366,9 @@ static void do_scan()
 
    read_records(bjcr->read_dcr, record_cb, bscan_mount_next_read_volume);
 
+   if (update_db) {
+      db_write_batch_file_records(bjcr); /* used by bulk batch file insert */
+   }
    free_attr(attr);
 }