From ab71d275c38b45c8f32d2f9556282631d741f06f Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 4 Nov 2005 16:17:21 +0000 Subject: [PATCH] Tweak #ifdefing a bit in new Win32 stream code. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2540 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/restore.c | 6 ++-- bacula/src/findlib/bfile.c | 56 ++++++++------------------------------ bacula/src/findlib/find.h | 17 ++++-------- 3 files changed, 18 insertions(+), 61 deletions(-) diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index cfda593a2c..ae1ff8e00e 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -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; diff --git a/bacula/src/findlib/bfile.c b/bacula/src/findlib/bfile.c index 6b740f88b9..b04675b685 100644 --- a/bacula/src/findlib/bfile.c +++ b/bacula/src/findlib/bfile.c @@ -12,19 +12,14 @@ 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 */ diff --git a/bacula/src/findlib/find.h b/bacula/src/findlib/find.h index 9e4c0b9bbd..cb1e44e002 100755 --- a/bacula/src/findlib/find.h +++ b/bacula/src/findlib/find.h @@ -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; -- 2.39.5