]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/dvd.c
kes Move the checking of the database in initializion of the Director
[bacula/bacula] / bacula / src / stored / dvd.c
index 8a45fd78c3917d8538039d1a065671b07ab406e9..a739e320a116d071adce426826cd5e5db152d575 100644 (file)
@@ -8,19 +8,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2005-2006 Kern Sibbald
+   Bacula® - The Network Backup Solution
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
+   Copyright (C) 2005-2006 Free Software Foundation Europe e.V.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   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.
 
- */
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 #include "stored.h"
@@ -305,7 +318,7 @@ int dvd_open_next_part(DCR *dcr)
    if (dev->can_append() && (dev->part > dev->num_dvd_parts) && 
        (dev->part_size == 0)) {
       Dmsg0(29, "open_next_part exited immediately (dev->part_size == 0).\n");
-      return dev->fd;
+      return dev->fd();
    }
 
    dev->close_part(dcr);               /* close current part */
@@ -379,7 +392,7 @@ int dvd_open_next_part(DCR *dcr)
    } 
    dev->set_labeled();                   /* all next parts are "labeled" */
    
-   return dev->fd;
+   return dev->fd();
 }
 
 /*
@@ -422,7 +435,7 @@ boffset_t lseek_dvd(DCR *dcr, boffset_t offset, int whence)
    boffset_t pos;
    char ed1[50], ed2[50];
    
-   Dmsg5(400, "Enter lseek_dvd fd=%d off=%s w=%d part=%d nparts=%d\n", dev->fd,
+   Dmsg5(400, "Enter lseek_dvd fd=%d off=%s w=%d part=%d nparts=%d\n", dev->fd(),
       edit_int64(offset, ed1), whence, dev->part, dev->num_dvd_parts);
 
    switch(whence) {
@@ -434,9 +447,9 @@ boffset_t lseek_dvd(DCR *dcr, boffset_t offset, int whence)
              (uint64_t)offset < dev->part_start+dev->part_size) {
             /* We are staying in the current part, just seek */
 #if defined(HAVE_WIN32)
-            pos = _lseeki64(dev->fd, offset-dev->part_start, SEEK_SET);
+            pos = _lseeki64(dev->fd(), offset-dev->part_start, SEEK_SET);
 #else
-            pos = lseek(dev->fd, offset-dev->part_start, SEEK_SET);
+            pos = lseek(dev->fd(), offset-dev->part_start, SEEK_SET);
 #endif
             if (pos < 0) {
                return pos;
@@ -473,7 +486,7 @@ boffset_t lseek_dvd(DCR *dcr, boffset_t offset, int whence)
       break;
    case SEEK_CUR:
       Dmsg1(400, "lseek_dvd SEEK_CUR to %s\n", edit_int64(offset, ed1));
-      if ((pos = lseek(dev->fd, (off_t)0, SEEK_CUR)) < 0) {
+      if ((pos = lseek(dev->fd(), (off_t)0, SEEK_CUR)) < 0) {
          Dmsg0(400, "Seek error.\n");
          return pos;                  
       }
@@ -505,7 +518,7 @@ boffset_t lseek_dvd(DCR *dcr, boffset_t offset, int whence)
        *  right part number, simply seek
        */
       if (dev->is_part_spooled() && dev->part > dev->num_dvd_parts) {
-         if ((pos = lseek(dev->fd, (off_t)0, SEEK_END)) < 0) {
+         if ((pos = lseek(dev->fd(), (off_t)0, SEEK_END)) < 0) {
             return pos;   
          } else {
             Dmsg1(400, "lseek_dvd SEEK_END returns %s\n",