]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/restore.c
Add heap stats to Dir and SD -- eliminate #ifdefs
[bacula/bacula] / bacula / src / dird / restore.c
index 5dc2398f129164eb660b4d9819efb3d6e9b604c8..e8b0da28f21723595d820602008ae5e0dacbdbf8 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -73,8 +73,7 @@ int do_restore(JCR *jcr)
    }
 
    memset(&rjr, 0, sizeof(rjr));
-   jcr->jr.Level = L_FULL;        /* Full restore */
-   jcr->jr.StartTime = jcr->start_time;
+   jcr->jr.JobLevel = L_FULL;        /* Full restore */
    if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
       Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db));
       restore_cleanup(jcr, JS_ErrorTerminated);
@@ -226,7 +225,8 @@ int do_restore(JCR *jcr)
 
    /* Send restore command */
    char replace, *where;
-
+   char empty = '\0';
+   
    if (jcr->replace != 0) {
       replace = jcr->replace;
    } else if (jcr->job->replace != 0) {
@@ -239,7 +239,7 @@ int do_restore(JCR *jcr)
    } else if (jcr->job->RestoreWhere) {
       where = jcr->job->RestoreWhere; /* no override take from job */
    } else {
-      where = "";                     /* None */
+      where = ∅                /* None */
    }
    jcr->prefix_links = jcr->job->PrefixLinks;
    bash_spaces(where);
@@ -267,7 +267,7 @@ static void restore_cleanup(JCR *jcr, int TermCode)
    char sdt[MAX_TIME_LENGTH], edt[MAX_TIME_LENGTH];
    char ec1[30], ec2[30], ec3[30];
    char term_code[100], fd_term_msg[100], sd_term_msg[100];
-   char *term_msg;
+   const char *term_msg;
    int msg_type;
    double kbps;
 
@@ -279,7 +279,11 @@ static void restore_cleanup(JCR *jcr, int TermCode)
    msg_type = M_INFO;                /* by default INFO message */
    switch (TermCode) {
    case JS_Terminated:
-      term_msg = _("Restore OK");
+      if (jcr->ExpectedFiles > jcr->jr.JobFiles) {
+         term_msg = _("Restore OK -- warning file count mismatch");
+      } else {
+         term_msg = _("Restore OK");
+      }
       break;
    case JS_FatalError:
    case JS_ErrorTerminated: