]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/backup.c
dhb left console.cpp uncompileable. Modified a comment in mainwin.cpp
[bacula/bacula] / bacula / src / filed / backup.c
index 4af0603576fabe9c5593b2976f06a8028c62119c..f218f52f15c002777cd2122d331740532f3617ec 100644 (file)
@@ -211,6 +211,7 @@ bool blast_data_to_storage_daemon(JCR *jcr, char *addr)
  */
 static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level)
 {
+   bool do_read = false;
    int stat, data_stream; 
    int rtnstat = 0;
    DIGEST *digest = NULL;
@@ -406,10 +407,19 @@ 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 ||
+
+   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);