Ticket #2242: file-size.patch

File file-size.patch, 639 bytes (added by bolek-mythtv@…, 15 years ago)
  • programs/mythbackend/mainserver.cpp

     
    16191619    // Get the on disk file size and disk block size.
    16201620    struct stat buf;
    16211621    fstat(fd, &buf);
    1622     size_t fsize = buf.st_blksize * buf.st_blocks;
     1622    size_t fsize =
     1623        ((buf.st_size + buf.st_blksize - 1) / buf.st_blksize) * buf.st_blksize;
    16231624
    16241625    // Round truncate increment up to a blocksize, w/min of 1 block.
    16251626    increment = ((increment / buf.st_blksize) + 1) * buf.st_blksize;