]> git.sur5r.net Git - bacula/bacula/commitdiff
Tweak #ifdefing a bit in new Win32 stream code.
authorKern Sibbald <kern@sibbald.com>
Fri, 4 Nov 2005 16:17:21 +0000 (16:17 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 4 Nov 2005 16:17:21 +0000 (16:17 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2540 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/filed/restore.c
bacula/src/findlib/bfile.c
bacula/src/findlib/find.h

index cfda593a2c5a5a95e4b8a009d8f4cfec9fa197e0..ae1ff8e00e02ee0a40dea98866aee6dca1174216 100644 (file)
@@ -35,6 +35,7 @@ static char rec_header[] = "rechdr %ld %ld %ld %ld %ld";
 #ifdef HAVE_LIBZ
 static const char *zlib_strerror(int stat);
 #endif
+
 int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen,
       uint64_t *addr, int flags);
 
@@ -291,13 +292,10 @@ void do_restore(JCR *jcr)
                flags |= FO_GZIP;
             }
 
-#ifdef USE_WIN32STREAMEXTRACTION
-/* THIS DETERMINES IF WE USE THE WIN32 BACKUPSTREAM DECOMPOSITION */
             if (is_win32_stream(stream) && !have_win32_api()) {
                set_portable_backup(&bfd);
-               flags |= FO_WIN32DECOMP;
+               flags |= FO_WIN32DECOMP;    /* "decompose BackupWrite data */
             }
-#endif
 
             if (extract_data(jcr, &bfd, sd->msg, sd->msglen, &fileAddr, flags) < 0) {
                extract = false;
index 6b740f88b9b1046a672586bcf88e5079a2cafb47..b04675b6852faf82910a7f95ba9a0ec69c88c8ca 100644 (file)
    Copyright (C) 2003-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   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.
 
    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., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
@@ -110,8 +105,9 @@ BOOL processWin32BackupAPIBlock (BFILE *bfd, void *pBuffer, size_t dwSize)
    LONGLONG dwDataOffset = 0;
    LONGLONG dwDataLen;
 
-   /* Win32 Stream Header size without name of strem.
-      = sizeof (WIN32_STREAM_ID)- sizeof(WCHAR*); */
+   /* Win32 Stream Header size without name of stream.
+    * = sizeof (WIN32_STREAM_ID)- sizeof(WCHAR*); 
+    */
    DWORD dwSizeHeader = 20; 
 
    do {               
@@ -636,10 +632,10 @@ bool is_stream_supported(int stream)
 #ifndef HAVE_LIBZ
    case STREAM_GZIP_DATA:
    case STREAM_SPARSE_GZIP_DATA:
+   case STREAM_WIN32_GZIP_DATA:    
 #endif
 #ifndef USE_WIN32STREAMEXTRACTION
    case STREAM_WIN32_DATA:
-   case STREAM_WIN32_GZIP_DATA:
 #endif
 #ifndef HAVE_DARWIN_OS
    case STREAM_MACOS_FORK_DATA:
@@ -654,9 +650,9 @@ bool is_stream_supported(int stream)
 #endif
 #ifdef USE_WIN32STREAMEXTRACTION
    case STREAM_WIN32_DATA:
-#endif
-#if defined(USE_WIN32STREAMEXTRACTION) && defined(HAVE_LIBZ)
+# ifdef HAVE_LIBZ 
    case STREAM_WIN32_GZIP_DATA:    
+# endif
 #endif
    case STREAM_UNIX_ATTRIBUTES:
    case STREAM_FILE_DATA:
@@ -677,36 +673,6 @@ bool is_stream_supported(int stream)
    return 0;
 }
 
-/* Old file reader code */
-#ifdef xxx
-   if (bfd->prog) {
-      POOLMEM *ecmd = get_pool_memory(PM_FNAME);
-      ecmd = edit_job_codes(bfd->jcr, ecmd, bfd->prog, fname);
-      const char *pmode;
-      if (flags & O_RDONLY) {
-         pmode = "r";
-      } else {
-         pmode = "w";
-      }
-      bfd->bpipe = open_bpipe(ecmd, 0, pmode);
-      if (bfd->bpipe == NULL) {
-         bfd->berrno = errno;
-         bfd->fid = -1;
-         free_pool_memory(ecmd);
-         return -1;
-      }
-      free_pool_memory(ecmd);
-      if (flags & O_RDONLY) {
-         bfd->fid = fileno(bfd->bpipe->rfd);
-      } else {
-         bfd->fid = fileno(bfd->bpipe->wfd);
-      }
-      errno = 0;
-      return bfd->fid;
-   }
-#endif
-
-
 int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode)
 {
    /* Open reader/writer program */
index 9e4c0b9bbd6fe24909ffac7c48e43773f301e9cb..cb1e44e002fcf81740240158630ce711619ab33c 100755 (executable)
@@ -7,19 +7,14 @@
    Copyright (C) 2001-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   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.
 
    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., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
@@ -90,9 +85,7 @@ enum {
 #define FO_NO_HARDLINK  (1<<15)       /* don't handle hard links */
 #define FO_IGNORECASE   (1<<16)       /* Ignore file name case */
 #define FO_HFSPLUS      (1<<17)       /* Resource forks and Finder Info */
-#ifdef USE_WIN32STREAMEXTRACTION
 #define FO_WIN32DECOMP  (1<<18)       /* Use BackupRead decomposition */
-#endif
 
 struct s_included_file {
    struct s_included_file *next;