]> git.sur5r.net Git - bacula/bacula/commitdiff
Final changes
authorKern Sibbald <kern@sibbald.com>
Wed, 9 Jun 2004 12:44:37 +0000 (12:44 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 9 Jun 2004 12:44:37 +0000 (12:44 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1401 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/ua_label.c

index f69b64bf20a2efcf167009a4e71c89d9857dd788..8c3cd474ff817a12ea019b94e4ccfca61d730f45 100644 (file)
@@ -583,6 +583,7 @@ static int send_label_request(UAContext *ua, MEDIA_DBR *mr, MEDIA_DBR *omr,
         ok = TRUE;
       } 
    }
+   close_sd_bsock(ua);
    unbash_spaces(mr->VolumeName);
    unbash_spaces(mr->MediaType);
    unbash_spaces(pr->Name);
@@ -646,6 +647,7 @@ static char *get_volume_name_from_SD(UAContext *ua, int Slot)
    int rtn_slot;
 
    if (!(sd=open_sd_bsock(ua))) {
+      bsendmsg(ua, _("Could not open SD socket.\n"));
       return NULL;
    }
    bstrncpy(dev_name, store->dev_name, sizeof(dev_name));
@@ -657,6 +659,7 @@ static char *get_volume_name_from_SD(UAContext *ua, int Slot)
    /* Get Volume name in this Slot */
    while (bnet_recv(sd) >= 0) {
       bsendmsg(ua, "%s", sd->msg);
+      Dmsg1(100, "Got: %s", sd->msg);
       if (strncmp(sd->msg, "3001 Volume=", 12) == 0) {
         VolName = (char *)malloc(sd->msglen);
          if (sscanf(sd->msg, "3001 Volume=%s Slot=%d", VolName, &rtn_slot) == 2) {
@@ -666,6 +669,7 @@ static char *get_volume_name_from_SD(UAContext *ua, int Slot)
         VolName = NULL;
       }
    }
+   close_sd_bsock(ua);
    Dmsg1(200, "get_vol_name=%s\n", NPRT(VolName));
    return VolName;
 }