From a3761b5f4ae221477fd19be9e9c16071f12c1a60 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Thu, 15 Mar 2007 10:31:52 +0000 Subject: [PATCH] Fix ACLS on zero length files on Windows. Add ENODATA definition for building using MSVC. Add new bsock.c to MSVC build. Fix exports for MSVC. Fix problem with icons not being removed for task bar on exit. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4345 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/backup.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 4af0603576..a4b9d74d4b 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -406,10 +406,20 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) * Note, if is_win32_backup, we must open the Directory so that * the BackupRead will save its permissions and ownership streams. */ - if (ff_pkt->type != FT_LNKSAVED && (S_ISREG(ff_pkt->statp.st_mode) && - ff_pkt->statp.st_size > 0) || - ff_pkt->type == FT_RAW || ff_pkt->type == FT_FIFO || + bool do_read = false; + + if (ff_pkt->type != FT_LNKSAVED && S_ISREG(ff_pkt->statp.st_mode)) { +#ifdef HAVE_WIN32 + do_read = !is_portable_backup(&ff_pkt->bfd) || ff_pkt->statp.st_size > 0; +#else + do_read = ff_pkt->statp.st_size > 0; +#endif + } else if (ff_pkt->type == FT_RAW || ff_pkt->type == FT_FIFO || (!is_portable_backup(&ff_pkt->bfd) && ff_pkt->type == FT_DIREND)) { + do_read = true; + } + + if (do_read) { btimer_t *tid; if (ff_pkt->type == FT_FIFO) { tid = start_thread_timer(pthread_self(), 60); -- 2.39.5