]> git.sur5r.net Git - bacula/bacula/commitdiff
- Landon's fix for NLS detection
authorKern Sibbald <kern@sibbald.com>
Mon, 22 Aug 2005 07:38:10 +0000 (07:38 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 22 Aug 2005 07:38:10 +0000 (07:38 +0000)
- Eliminate incorrect compiler warning on FreeBSD.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2349 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/ChangeLog
bacula/ReleaseNotes
bacula/kernstodo
bacula/kes-1.37
bacula/src/stored/autochanger.c

index 3e1a2cbc99927cf0495603e4e35a0a204764bd1e..c6de0d5ab51b3646b2e146434a9c01fe0e7c749f 100644 (file)
@@ -1,5 +1,8 @@
-Changes to 1.37.36
+Changes to 1.37.36 released 22 Aug 05
 20Aug05
+- Landon's fix for NLS detection
+- Eliminate incorrect compiler warning on FreeBSD. 
+- Move Win32 errno message build into berrno constructor.
 - Minor Win32 tweaks
 19Aug05
 - A number of minor Win32 fixes.
index 5044eb4389cf69bf71239421857ca0942e4a6f74..bf1114312c284af3ea8c3b3c981c56575d2c68dd 100644 (file)
@@ -8,7 +8,7 @@ Major Changes:
   autochangers.
 - There is a new database format that is not compatible
   with previous databases. You must upgrade if converting
-  from 1.36.x.
+  from 1.36.x. No changes from version 1.37.30.
 - The Director, Storage daemon, and File daemons are
   Deamons are not compatible with  prior versions. 
   All FDs must be upgraded at the same time.
@@ -156,6 +156,12 @@ New Commands:
    sure no Python scripts are running. This permits you to change
    a Python script and get Bacula to use the new script.
 
+New configure options:
+- --with-libintl-prefix for defining alternate locations for
+  the NLS internationalization libraries. Not normally required.
+- --datadir  for defining where the language files will be installed
+  required only if you do not want the default /usr/share.
+
 Items to note!!!
 - You must add --with-python=[DIR] to the configure command line
   if you want Python support.  Python 2.2, 2.3 and 2.4 should be 
index f55d44d00442b8b330c51d86c66bcf8a700c75f2..fba0879df90aecdc45ba8f8dd3feca50f60d5c64 100644 (file)
@@ -12,7 +12,6 @@ Final items for 1.37 before release:
 - Look at fixing restore status stats in SD.
 
 -  --without-openssl breaks at least on Solaris.
-9. Run the regression scripts on Solaris and FreeBSD
 -  Figure out how to package gui, and rescue programs.
 -  Test TLS.
 -  Arno had to do -- to get update slots=x to work
@@ -1420,3 +1419,5 @@ Block Position: 0
 - The SD locks on to the first available drive then
   wants a Volume that is released but in another drive --
   chaos.
+- Run the regression scripts on Solaris and FreeBSD
+
index d6f2c590aecbb5c81881632da5295712a3db00ea..21090459a9ada129de64e5ef7b6d6f9cdca4c2ca 100644 (file)
@@ -5,6 +5,7 @@ General:
 
 Changes to 1.37.36:
 20Aug05
+- Landon's fix for NLS detection
 - Eliminate incorrect compiler warning on FreeBSD. 
 - Move Win32 errno message build into berrno constructor.
 - Minor Win32 build tweaks
index cf78a72c1884b3bbe67ec4627db0de80184b88f2..7eb129d851f67503497085d2c92bd7bd609ef521 100644 (file)
@@ -3,7 +3,7 @@
  *  Routines for handling the autochanger.
  *
  *   Kern Sibbald, August MMII
- *                           
+ *                            
  *   Version $Id$
  */
 /*
@@ -40,8 +40,8 @@ static bool unload_other_drive(DCR *dcr, int slot);
  *   dir bsock.
  *
  *  Returns: 1 on success
- *          0 on failure (no changer available)
- *         -1 on error on autochanger
+ *           0 on failure (no changer available)
+ *          -1 on error on autochanger
  */
 int autoload_device(DCR *dcr, int writing, BSOCK *dir)
 {
@@ -49,22 +49,22 @@ int autoload_device(DCR *dcr, int writing, BSOCK *dir)
    DEVICE *dev = dcr->dev;
    int slot;
    int drive = dev->drive_index;
-   int rtn_stat = -1;                /* error status */
+   int rtn_stat = -1;                 /* error status */
    POOLMEM *changer;
 
    slot = dcr->VolCatInfo.InChanger ? dcr->VolCatInfo.Slot : 0;
    /*
-    * Handle autoloaders here. If we cannot autoload it, we
+    * Handle autoloaders here.  If we cannot autoload it, we
     *  will return 0 so that the sysop will be asked to load it.
     */
    if (writing && dev->is_autochanger() && slot <= 0) {
       if (dir) {
-        return 0;                    /* For user, bail out right now */
+         return 0;                    /* For user, bail out right now */
       }
       if (dir_find_next_appendable_volume(dcr)) {
-        slot = dcr->VolCatInfo.InChanger ? dcr->VolCatInfo.Slot : 0;
+         slot = dcr->VolCatInfo.InChanger ? dcr->VolCatInfo.Slot : 0;
       } else {
-        slot = 0;
+         slot = 0;
       }
    }
    Dmsg1(400, "Want changer slot=%d\n", slot);
@@ -77,50 +77,50 @@ int autoload_device(DCR *dcr, int writing, BSOCK *dir)
       loaded = get_autochanger_loaded_slot(dcr);
 
       if (loaded != slot) {
-        /* Unload anything in our drive */
-        if (!unload_autochanger(dcr, loaded)) {
-           goto bail_out;
-        }
-           
-        /* Make sure desired slot is unloaded */
-        if (!unload_other_drive(dcr, slot)) {
-           goto bail_out;
-        }
-
-        /*
-         * Load the desired cassette
-         */
+         /* Unload anything in our drive */
+         if (!unload_autochanger(dcr, loaded)) {
+            goto bail_out;
+         }
+            
+         /* Make sure desired slot is unloaded */
+         if (!unload_other_drive(dcr, slot)) {
+            goto bail_out;
+         }
+
+         /*
+          * Load the desired cassette
+          */
          Dmsg1(400, "Doing changer load slot %d\n", slot);
-        Jmsg(jcr, M_INFO, 0,
+         Jmsg(jcr, M_INFO, 0,
               _("3304 Issuing autochanger \"load slot %d, drive %d\" command.\n"),
-             slot, drive);
-        dcr->VolCatInfo.Slot = slot;    /* slot to be loaded */
-        changer = edit_device_codes(dcr, changer, 
+              slot, drive);
+         dcr->VolCatInfo.Slot = slot;    /* slot to be loaded */
+         changer = edit_device_codes(dcr, changer, 
                       dcr->device->changer_command, "load");
-        status = run_program(changer, timeout, NULL);
-        if (status == 0) {
+         status = run_program(changer, timeout, NULL);
+         if (status == 0) {
             Jmsg(jcr, M_INFO, 0, _("3305 Autochanger \"load slot %d, drive %d\", status is OK.\n"),
-                   slot, drive);
-           dev->Slot = slot;         /* set currently loaded slot */
-        } else {
-          berrno be;
-          be.set_errno(status);
+                    slot, drive);
+            dev->Slot = slot;         /* set currently loaded slot */
+         } else {
+           berrno be;
+           be.set_errno(status);
             Jmsg(jcr, M_FATAL, 0, _("3992 Bad autochanger \"load slot %d, drive %d\": ERR=%s.\n"),
-                   slot, drive, be.strerror());
-           goto bail_out;
-        }
-        unlock_changer(dcr);
+                    slot, drive, be.strerror());
+            goto bail_out;
+         }
+         unlock_changer(dcr);
          Dmsg2(400, "load slot %d status=%d\n", slot, status);
       } else {
-        status = 0;                  /* we got what we want */
-        dev->Slot = slot;            /* set currently loaded slot */
+         status = 0;                  /* we got what we want */
+         dev->Slot = slot;            /* set currently loaded slot */
       }
       Dmsg1(400, "After changer, status=%d\n", status);
-      if (status == 0) {             /* did we succeed? */
-        rtn_stat = 1;                /* tape loaded by changer */
+      if (status == 0) {              /* did we succeed? */
+         rtn_stat = 1;                /* tape loaded by changer */
       }
    } else {
-      rtn_stat = 0;                  /* no changer found */
+      rtn_stat = 0;                   /* no changer found */
    }
    free_pool_memory(changer);
    return rtn_stat;
@@ -134,7 +134,7 @@ bail_out:
 
 /*
  * Returns: -1 if error from changer command
- *         slot otherwise
+ *          slot otherwise
  */
 int get_autochanger_loaded_slot(DCR *dcr)
 {
@@ -151,7 +151,7 @@ int get_autochanger_loaded_slot(DCR *dcr)
 
    /* Find out what is loaded, zero means device is unloaded */
    Jmsg(jcr, M_INFO, 0, _("3301 Issuing autochanger \"loaded drive %d\" command.\n"),
-       drive);
+        drive);
    changer = edit_device_codes(dcr, changer, dcr->device->changer_command, "loaded");
    *results = 0;
    status = run_program(changer, timeout, results);
@@ -160,19 +160,19 @@ int get_autochanger_loaded_slot(DCR *dcr)
       loaded = atoi(results);
       if (loaded > 0) {
          Jmsg(jcr, M_INFO, 0, _("3302 Autochanger \"loaded drive %d\", result is Slot %d.\n"),
-             drive, loaded);
-        dcr->dev->Slot = loaded;
+              drive, loaded);
+         dcr->dev->Slot = loaded;
       } else {
          Jmsg(jcr, M_INFO, 0, _("3302 Autochanger \"loaded drive %d\", result: nothing loaded.\n"),
-             drive);
-        dcr->dev->Slot = 0;
+              drive);
+         dcr->dev->Slot = 0;
       }
    } else {
       berrno be;
       be.set_errno(status);
       Jmsg(jcr, M_INFO, 0, _("3991 Bad autochanger \"loaded drive %d\" command: ERR=%s.\n"),
-          drive, be.strerror());
-      loaded = -1;             /* force unload */
+           drive, be.strerror());
+      loaded = -1;              /* force unload */
    }
    unlock_changer(dcr);
    free_pool_memory(changer);
@@ -201,8 +201,8 @@ static void unlock_changer(DCR *dcr)
 /*
  * Unload the volume, if any, in this drive
  *  On entry: loaded == 0 -- nothing to do
- *           loaded  < 0 -- check if anything to do
- *           loaded  > 0 -- load slot == loaded
+ *            loaded  < 0 -- check if anything to do
+ *            loaded  > 0 -- load slot == loaded
  */
 bool unload_autochanger(DCR *dcr, int loaded)
 {
@@ -232,7 +232,7 @@ bool unload_autochanger(DCR *dcr, int loaded)
       POOLMEM *changer = get_pool_memory(PM_FNAME);
       Jmsg(jcr, M_INFO, 0,
            _("3307 Issuing autochanger \"unload slot %d, drive %d\" command.\n"),
-          loaded, dev->drive_index);
+           loaded, dev->drive_index);
       slot = dcr->VolCatInfo.Slot;
       dcr->VolCatInfo.Slot = loaded;
       changer = edit_device_codes(dcr, changer, 
@@ -242,13 +242,13 @@ bool unload_autochanger(DCR *dcr, int loaded)
       unlock_changer(dcr);
       dcr->VolCatInfo.Slot = slot;
       if (stat != 0) {
-        berrno be;
-        be.set_errno(stat);
+         berrno be;
+         be.set_errno(stat);
          Jmsg(jcr, M_INFO, 0, _("3995 Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n"),
-                slot, dev->drive_index, be.strerror());
-        ok = false;
+                 slot, dev->drive_index, be.strerror());
+         ok = false;
       } else {
-        dev->Slot = 0;            /* nothing loaded */
+         dev->Slot = 0;            /* nothing loaded */
       }
       free_pool_memory(changer);
    }
@@ -260,7 +260,8 @@ bool unload_autochanger(DCR *dcr, int loaded)
  */
 static bool unload_other_drive(DCR *dcr, int slot)
 {
-   DEVICE *dev, *save_dev;
+   DEVICE *dev = NULL;
+   DEVICE *save_dev;
    JCR *jcr = dcr->jcr;
    int save_slot;
    uint32_t timeout = dcr->device->max_changer_wait;
@@ -278,9 +279,9 @@ static bool unload_other_drive(DCR *dcr, int slot)
       
    foreach_alist(device, changer->device) {
       if (device->dev && device->dev->Slot == slot) {
-        found = true;
-        dev = device->dev;
-        break;
+         found = true;
+         dev = device->dev;
+         break;
       }
    }
    if (!found) {
@@ -288,9 +289,9 @@ static bool unload_other_drive(DCR *dcr, int slot)
    }
    if (dev->is_busy()) {
       Jmsg(jcr, M_WARNING, 0, _("Volume %s is in use by device %s\n"),
-          dcr->VolumeName, dev->print_name());
+           dcr->VolumeName, dev->print_name());
       Dmsg2(200, "Volume %s is in use by device %s\n",
-          dcr->VolumeName, dev->print_name());
+           dcr->VolumeName, dev->print_name());
       
       return false;
    }
@@ -302,10 +303,10 @@ static bool unload_other_drive(DCR *dcr, int slot)
    POOLMEM *changer_cmd = get_pool_memory(PM_FNAME);
    Jmsg(jcr, M_INFO, 0,
         _("3307 Issuing autochanger \"unload slot %d, drive %d\" command.\n"),
-       slot, dev->drive_index);
+        slot, dev->drive_index);
 
    Dmsg2(200, "Issuing autochanger \"unload slot %d, drive %d\" command.\n",
-       slot, dev->drive_index);
+        slot, dev->drive_index);
 
    save_slot = dcr->VolCatInfo.Slot;
    save_dev = dcr->dev;
@@ -323,13 +324,13 @@ static bool unload_other_drive(DCR *dcr, int slot)
       berrno be;
       be.set_errno(stat);
       Jmsg(jcr, M_INFO, 0, _("3995 Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n"),
-             slot, dev->drive_index, be.strerror());
+              slot, dev->drive_index, be.strerror());
 
       Dmsg3(200, "Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n",
-             slot, dev->drive_index, be.strerror());
+              slot, dev->drive_index, be.strerror());
       ok = false;
    } else {
-      dev->Slot = 0;           /* nothing loaded */
+      dev->Slot = 0;            /* nothing loaded */
       Dmsg0(200, "Slot unloaded\n");
    }
    free_pool_memory(changer_cmd);
@@ -356,7 +357,7 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd)
    if (!dev->is_autochanger() || !dcr->device->changer_name ||
        !dcr->device->changer_command) {
       bnet_fsend(dir, _("3993 Device %s not an autochanger device.\n"),
-        dev->print_name());
+         dev->print_name());
       return false;
    }
 
@@ -368,7 +369,7 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd)
 
    /* Now issue the command */
    changer = edit_device_codes(dcr, changer, 
-                dcr->device->changer_command, cmd);
+                 dcr->device->changer_command, cmd);
    bnet_fsend(dir, _("3306 Issuing autochanger \"%s\" command.\n"), cmd);
    lock_changer(dcr);
    bpipe = open_bpipe(changer, timeout, "r");
@@ -380,9 +381,9 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd)
    if (strcmp(cmd, "list") == 0) {
       /* Get output from changer */
       while (fgets(dir->msg, len, bpipe->rfd)) {
-        dir->msglen = strlen(dir->msg);
+         dir->msglen = strlen(dir->msg);
          Dmsg1(100, "<stored: %s\n", dir->msg);
-        bnet_send(dir);
+         bnet_send(dir);
       }
    } else {
       /* For slots command, read a single line */
@@ -392,7 +393,7 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd)
       Dmsg1(100, "<stored: %s", dir->msg);
       bnet_send(dir);
    }
-                
+                 
    stat = close_bpipe(bpipe);
    unlock_changer(dcr);
    if (stat != 0) {
@@ -438,52 +439,52 @@ char *edit_device_codes(DCR *dcr, char *omsg, const char *imsg, const char *cmd)
    Dmsg1(1800, "edit_device_codes: %s\n", imsg);
    for (p=imsg; *p; p++) {
       if (*p == '%') {
-        switch (*++p) {
+         switch (*++p) {
          case '%':
             str = "%";
-           break;
+            break;
          case 'a':
-           str = dcr->dev->archive_name();
-           break;
+            str = dcr->dev->archive_name();
+            break;
          case 'c':
-           str = NPRT(dcr->device->changer_name);
-           break;
+            str = NPRT(dcr->device->changer_name);
+            break;
          case 'd':
             sprintf(add, "%d", dcr->dev->drive_index);
-           str = add;
-           break;
+            str = add;
+            break;
          case 'o':
-           str = NPRT(cmd);
-           break;
+            str = NPRT(cmd);
+            break;
          case 's':
             sprintf(add, "%d", dcr->VolCatInfo.Slot - 1);
-           str = add;
-           break;
+            str = add;
+            break;
          case 'S':
             sprintf(add, "%d", dcr->VolCatInfo.Slot);
-           str = add;
-           break;
+            str = add;
+            break;
          case 'j':                    /* Job name */
-           str = dcr->jcr->Job;
-           break;
+            str = dcr->jcr->Job;
+            break;
          case 'v':
-           str = NPRT(dcr->VolumeName);
-           break;
+            str = NPRT(dcr->VolumeName);
+            break;
          case 'f':
-           str = NPRT(dcr->jcr->client_name);
-           break;
+            str = NPRT(dcr->jcr->client_name);
+            break;
 
-        default:
+         default:
             add[0] = '%';
-           add[1] = *p;
-           add[2] = 0;
-           str = add;
-           break;
-        }
+            add[1] = *p;
+            add[2] = 0;
+            str = add;
+            break;
+         }
       } else {
-        add[0] = *p;
-        add[1] = 0;
-        str = add;
+         add[0] = *p;
+         add[1] = 0;
+         str = add;
       }
       Dmsg1(1900, "add_str %s\n", str);
       pm_strcat(&omsg, (char *)str);