Use the correct length for unmap, msync
authorLove Hörnquist Åstrand <lha@kth.se>
Thu, 29 May 2008 14:14:09 +0000 (14:14 +0000)
committerLove Hörnquist Åstrand <lha@kth.se>
Thu, 29 May 2008 14:14:09 +0000 (14:14 +0000)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23217 ec53bebd-3082-4978-b11e-865c3cabbd6b

appl/ftp/ftp/ftp.c

index 6783555487c95a86e6902830eb25edae8d38d61f..c5b29f7b86f5f7d7611d3eeb5422c9425cf57b9b 100644 (file)
@@ -610,7 +610,9 @@ copy_stream (FILE * from, FILE * to)
            }
                
            res = sec_write (fileno (to), chunk, len);
-           if (munmap (chunk, st.st_size) < 0)
+           if (msync (chunk, len, MS_ASYNC))
+               warn ("msync");
+           if (munmap (chunk, len) < 0)
                warn ("munmap");
            sec_fflush (to);
            if (res != len)