]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_status.c
kes Fix %g in filename returned by SQL for browse tree reported by
[bacula/bacula] / bacula / src / dird / ua_status.c
index 0fd354c30816723609de9dde1b3dd534fc78e77e..15acb884b66aef5257e49f828543860821116f72 100644 (file)
@@ -7,8 +7,8 @@
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -38,7 +38,7 @@
 #include "bacula.h"
 #include "dird.h"
 
-extern void *start_sbrk;
+extern void *start_heap;
 
 static void list_scheduled_jobs(UAContext *ua);
 static void list_running_jobs(UAContext *ua);
@@ -270,8 +270,8 @@ void list_dir_status_header(UAContext *ua)
       ua->send_msg(_("Daemon started %s, %d Jobs run since started.\n"),
         dt, num_jobs_run);
    }
-   ua->send_msg(_(" Heap: sbrk=%s bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),
-            edit_uint64_with_commas((uint64_t)sbrk(0)-(uint64_t)start_sbrk, b1),
+   ua->send_msg(_(" Heap: heap=%s smbytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),
+            edit_uint64_with_commas((char *)sbrk(0)-(char *)start_heap, b1),
             edit_uint64_with_commas(sm_bytes, b2),
             edit_uint64_with_commas(sm_max_bytes, b3),
             edit_uint64_with_commas(sm_buffers, b4),
@@ -598,7 +598,11 @@ static void list_running_jobs(UAContext *ua)
          break;
       case JS_WaitFD:
          emsg = (char *) get_pool_memory(PM_FNAME);
-         Mmsg(emsg, _("is waiting on Client %s"), jcr->client->name());
+         if (!jcr->client) {
+            Mmsg(emsg, _("is waiting on Client"));
+         } else {
+            Mmsg(emsg, _("is waiting on Client %s"), jcr->client->name());
+         }
          pool_mem = true;
          msg = emsg;
          break;
@@ -606,8 +610,10 @@ static void list_running_jobs(UAContext *ua)
          emsg = (char *) get_pool_memory(PM_FNAME);
          if (jcr->wstore) {
             Mmsg(emsg, _("is waiting on Storage %s"), jcr->wstore->name());
-         } else {
+         } else if (jcr->rstore) {
             Mmsg(emsg, _("is waiting on Storage %s"), jcr->rstore->name());
+         } else {
+            Mmsg(emsg, _("is waiting on Storage"));
          }
          pool_mem = true;
          msg = emsg;
@@ -632,7 +638,7 @@ static void list_running_jobs(UAContext *ua)
          break;
 
       default:
-         emsg = (char *) get_pool_memory(PM_FNAME);
+         emsg = (char *)get_pool_memory(PM_FNAME);
          Mmsg(emsg, _("is in unknown state %c"), jcr->JobStatus);
          pool_mem = true;
          msg = emsg;
@@ -661,8 +667,12 @@ static void list_running_jobs(UAContext *ua)
             emsg = (char *)get_pool_memory(PM_FNAME);
             pool_mem = true;
          }
-         Mmsg(emsg, _("is waiting for Client %s to connect to Storage %s"),
-              jcr->client->name(), jcr->wstore->name());
+         if (!jcr->client || !jcr->wstore) {
+            Mmsg(emsg, _("is waiting for Client to connect to Storage daemon"));
+         } else {
+            Mmsg(emsg, _("is waiting for Client %s to connect to Storage %s"),
+                 jcr->client->name(), jcr->wstore->name());
+        }
          msg = emsg;
          break;
       }