]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_output.c
23Aug07
[bacula/bacula] / bacula / src / dird / ua_output.c
index 7e3fb492799090b514e4d89a5085ffbee41fd17c..8bf7178d22bddc43a28989b8b3fab1d13d29df42 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
@@ -473,6 +473,10 @@ static bool list_nextvol(UAContext *ua, int ndays)
       if (!complete_jcr_for_job(jcr, job, run->pool)) {
          return false;
       }
+      if (!jcr->jr.PoolId) {
+         ua->error_msg(_("Could not Pool Job %s\n"), job->name());
+         continue;
+      }
       memset(&pr, 0, sizeof(pr));
       pr.PoolId = jcr->jr.PoolId;
       if (!db_get_pool_record(ua->jcr, ua->db, &pr)) {
@@ -482,12 +486,12 @@ static bool list_nextvol(UAContext *ua, int ndays)
       get_job_storage(&store, job, run);
       mr.StorageId = store.store->StorageId;
       if (!find_next_volume_for_append(jcr, &mr, 1, fnv_no_create_vol, fnv_prune)) {
-         ua->error_msg(_("Could not find next Volume for Job %s (%s, %s).\n"),
-            job->hdr.name, pr.Name, level_to_str(run->level));
+         ua->error_msg(_("Could not find next Volume for Job %s (Pool=%s, Level=%s).\n"),
+            job->name(), pr.Name, level_to_str(run->level));
       } else {
          ua->send_msg(
-            _("The next Volume to be used by Job \"%s\" (%s, %s) will be %s\n"),
-            job->hdr.name, pr.Name, level_to_str(run->level), mr.VolumeName);
+            _("The next Volume to be used by Job \"%s\" (Pool=%s, Level=%s) will be %s\n"),
+            job->name(), pr.Name, level_to_str(run->level), mr.VolumeName);
          found = true;
       }
       if (jcr->db && jcr->db != ua->db) {
@@ -721,11 +725,12 @@ void bmsg(UAContext *ua, const char *fmt, va_list arg_ptr)
 {
    BSOCK *bs = ua->UA_sock;
    int maxlen, len;
-   POOLMEM *msg;
+   POOLMEM *msg = NULL;
 
    if (bs) {
       msg = bs->msg;
-   } else {
+   }
+   if (!msg) {
       msg = get_pool_memory(PM_EMSG);
    }
 
@@ -781,8 +786,9 @@ void UAContext::error_msg(const char *fmt, ...)
 {
    BSOCK *bs = UA_sock;
    va_list arg_ptr;
-   va_start(arg_ptr, fmt);
+
    if (bs && api) bs->signal(BNET_ERROR_MSG);
+   va_start(arg_ptr, fmt);
    bmsg(this, fmt, arg_ptr);
    va_end(arg_ptr);
 }
@@ -796,8 +802,9 @@ void UAContext::warning_msg(const char *fmt, ...)
 {
    BSOCK *bs = UA_sock;
    va_list arg_ptr;
-   va_start(arg_ptr, fmt);
+
    if (bs && api) bs->signal(BNET_WARNING_MSG);
+   va_start(arg_ptr, fmt);
    bmsg(this, fmt, arg_ptr);
    va_end(arg_ptr);
 }
@@ -810,8 +817,9 @@ void UAContext::info_msg(const char *fmt, ...)
 {
    BSOCK *bs = UA_sock;
    va_list arg_ptr;
-   va_start(arg_ptr, fmt);
+
    if (bs && api) bs->signal(BNET_INFO_MSG);
+   va_start(arg_ptr, fmt);
    bmsg(this, fmt, arg_ptr);
    va_end(arg_ptr);
 }