~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to lib/ext2fs/imager.c

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2014-10-27 09:44:27 UTC
  • mfrom: (8.4.29 sid)
  • Revision ID: package-import@ubuntu.com-20141027094427-g56dce6sg7pasdgm
Tags: 1.42.12-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - debian/rules:
      Block pkg-create-dbgsym from operating on this package.
      Build without dietlibc-dev, which is in universe 
      Use the autotools-dev dh addon to update config.guess/config.sub for new
      ports.
  - debian/control:
      Regenerate with ./debian/rules debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
286
286
        ext2fs_generic_bitmap   bmap;
287
287
        errcode_t               retval;
288
288
        ssize_t                 actual;
289
 
        __u32                   itr, cnt, size;
290
 
        int                     c, total_size;
 
289
        size_t                  c;
 
290
        __u64                   itr, cnt, size, total_size;
291
291
        char                    buf[1024];
292
292
 
293
293
        if (flags & IMAGER_FLAG_INODEMAP) {
308
308
                }
309
309
                bmap = fs->block_map;
310
310
                itr = fs->super->s_first_data_block;
311
 
                cnt = EXT2_BLOCKS_PER_GROUP(fs->super) * fs->group_desc_count;
 
311
                cnt = EXT2_GROUPS_TO_BLOCKS(fs->super, fs->group_desc_count);
312
312
                size = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
313
313
        }
314
314
        total_size = size * fs->group_desc_count;
342
342
                        if (c > (int) sizeof(buf))
343
343
                                c = sizeof(buf);
344
344
                        actual = write(fd, buf, c);
345
 
                        if (actual == -1)
 
345
                        if (actual < 0)
346
346
                                return errno;
347
 
                        if (actual != c)
 
347
                        if ((size_t) actual != c)
348
348
                                return EXT2_ET_SHORT_WRITE;
349
349
                        size -= c;
350
350
                }
360
360
{
361
361
        ext2fs_generic_bitmap   bmap;
362
362
        errcode_t               retval;
363
 
        __u32                   itr, cnt;
 
363
        __u64                   itr, cnt;
364
364
        char                    buf[1024];
365
365
        unsigned int            size;
366
366
        ssize_t                 actual;
383
383
                }
384
384
                bmap = fs->block_map;
385
385
                itr = fs->super->s_first_data_block;
386
 
                cnt = EXT2_BLOCKS_PER_GROUP(fs->super) * fs->group_desc_count;
 
386
                cnt = EXT2_GROUPS_TO_BLOCKS(fs->super, fs->group_desc_count);
387
387
                size = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
388
388
        }
389
389