From: Robert Nelson Date: Thu, 15 Mar 2007 10:31:52 +0000 (+0000) Subject: Fix ACLS on zero length files on Windows. X-Git-Tag: Release-7.0.0~6767 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a3761b5f4ae221477fd19be9e9c16071f12c1a60;p=bacula%2Fbacula 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 --- 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);