[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH v2 2/3] NEW API: add a new api e2fsck

On Sat, Jan 14, 2012 at 12:03:44AM +0800, Wanlong Gao wrote:
> From: Wanlong Gao <gaowanlong cn fujitsu com>
> +  if (optargs_bitmask & GUESTFS_E2FSCK_CORRECT_BITMASK &&
> +      optargs_bitmask & GUESTFS_E2FSCK_FORCEALL_BITMASK) {

This needs to be:

  if (optargs_bitmask & GUESTFS_E2FSCK_CORRECT_BITMASK && correct
      optargs_bitmask & GUESTFS_E2FSCK_FORCEALL_BITMASK && forceall) {

but maybe it's better to write this, early on in the function:

  /* Default if not selected. */
  if (!(optargs_bitmask & GUESTFS_E2FSCK_CORRECT_BITMASK))
    correct = 0;
  if (!(optargs_bitmask & GUESTFS_E2FSCK_FORCEALL_BITMASK))
    forceall = 0;

then you can forget about optargs_bitmask in the rest of the function
and just use 'correct' and 'forceall' variables!

The rest looks fine to me.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]