r18824: fixed a bug in cifsdd when the file is exactly a multiple of the block
authorAndrew Tridgell <tridge@samba.org>
Fri, 22 Sep 2006 15:14:03 +0000 (15:14 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:19:14 +0000 (14:19 -0500)
size (cifsdd incorrectly reported an error and exited)

source/client/cifsdd.c

index eda25f904d6ab6df7515f044e4a960b5cdf9a430..0ebaa9e378f5338521d8c497a2934b96d022df3c 100644 (file)
@@ -498,7 +498,8 @@ static int copy_files(void)
                 * at least obs bytes in the IO buffer but might not if the
                 * file is too small.
                 */
-               if (!dd_flush_block(ofile, iobuf, &data_size, obs)) {
+               if (data_size && 
+                   !dd_flush_block(ofile, iobuf, &data_size, obs)) {
                        return(IOERROR_EXIT_CODE);
                }
        }