]> git.sur5r.net Git - bacula/bacula/commitdiff
small change to work with correct buffer size on raw partitions when on win32.
authorThorsten Engel <thorsten.engel@matrix-computer.com>
Tue, 12 Jul 2005 15:55:42 +0000 (15:55 +0000)
committerThorsten Engel <thorsten.engel@matrix-computer.com>
Tue, 12 Jul 2005 15:55:42 +0000 (15:55 +0000)
I assume the BSD code part (line 424) is faulty as it only is activated when SPARSE is on.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2191 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/filed/backup.c

index fe1b14348b5baa0bfaca76772d3d1b26d72955a9..f030b007e5b8f629b66b5951a0bfa7c35711365e 100644 (file)
@@ -425,6 +425,12 @@ int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, struct CHKSUM *chksum)
 #endif
    }
 
+   /* a RAW device read on win32 only works if the buffer is a multiple of 512 */
+#ifdef HAVE_WIN32
+   if (S_ISBLK(ff_pkt->statp.st_mode))
+      rsize = (rsize/512) * 512;      
+#endif
+
    /*
     * Read the file data
     */