]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix Win32 status.c
authorKern Sibbald <kern@sibbald.com>
Mon, 23 Feb 2004 10:12:59 +0000 (10:12 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 23 Feb 2004 10:12:59 +0000 (10:12 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1075 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/filed/status.c

index a2e94730fe144cb4ab4467e412b63fed94a9e92f..d33c536e8c8232ee4e61beb48347c259abba4816 100755 (executable)
@@ -108,7 +108,7 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
       if (sec <= 0) {
         sec = 1;
       }
-      bps = njcr->JobBytes / sec;
+      bps = (int)(njcr->JobBytes / sec);
       len = Mmsg(&msg,  _("    Files=%s Bytes=%s Bytes/sec=%s\n"), 
           edit_uint64_with_commas(njcr->JobFiles, b1),
           edit_uint64_with_commas(njcr->JobBytes, b2),
@@ -347,10 +347,12 @@ char *bac_status(int stat)
 {
    JCR *njcr;
    char *termstat = _("Bacula Idle");
+   struct s_last_job *job;
 
    bacstat = 0;
    if (last_jobs->size() > 0) {
-      switch (last_job.JobStatus) {
+      job = (struct s_last_job *)last_jobs->first();
+      switch (job->JobStatus) {
       case JS_Canceled:
         bacstat = -1;
          termstat = _("Last Job Canceled");
@@ -365,7 +367,7 @@ char *bac_status(int stat)
    }
    Dmsg0(1000, "Begin bac_status jcr loop.\n");
    lock_jcr_chain();
-   for (njcr=NULL; (njcr=get_next_jcr(njcr)); ) {
+   foreach_jcr(njcr) {
       if (njcr->JobId != 0) {
         bacstat = 1;
          termstat = _("Bacula Running");