Re: [git pull] cramfs fixes

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

 



On Thu, Jul 21, 2011 at 20:10, Karel Zak <kzak@xxxxxxxxxx> wrote:
>>       u32 namelen:6, offset:26;
>    ^^^
>  uint32_t

Oops. Fixed.

>> +/* Exit codes used by fsck-type programs */
>> +#define FSCK_OK                      0       /* No errors */
>> +#define FSCK_NONDESTRUCT     1       /* File system errors corrected */
>> +#define FSCK_REBOOT          2       /* System should be rebooted */
>> +#define FSCK_UNCORRECTED     4       /* File system errors left uncorrected */
>> +#define FSCK_ERROR           8       /* Operational error */
>> +#define FSCK_USAGE           16      /* Usage or syntax error */
>> +#define FSCK_LIBRARY         128     /* Shared library error */
>
>  I see magic numbers also in fsck.minix ;-)
>
>  What about to add include/exitcodes.h and move this and
>  disk-utils/mkfs.h to this file?

True. I added two patches which does exactly that.

      include: move disk-utils/mkfs.h -> include/exitcodes.h
      include: move fsck return values to exitcodes.h

>> [snip]
>> +                                     err(FSCK_ERROR, _("write failed: %s"),
>> +                                         path);
>> +                     curr = next;
>>               }
>       ^^^
>
> the 'if (opt_extract)' block is outsize 'if (size >= page_size)'...

Correct, the mistake is fixed.

>> [snip]
>> +             if ((S_ISUID | S_ISGID) & i->mode)
>> +                     if (chmod(path, i->mode) < 0)
>> +                             err(FSCK_ERROR, _("chown failed: %s"), path);
>>       }
>
>      if (((S_ISUID | S_ISGID) & i->mode) && chmod(path, i->mode) < 0)
>           err(FSCK_ERROR, _("chown failed: %s"), path);

Changed to single if.

>> -                     blksize = atoi(optarg);
>> +                     blksize = strtoll_or_err(optarg, _("blocksize argument failed"));
>
>  hmm... "failed to parse blocksize argument" ?

Changed to "failed to parse".

>>                       else if (strcmp(optarg, "host") == 0);  /* default */
>> [snip]
>
>   else if (strcmp(optarg, "host") == 0)
>        ; /* default */

This and...

>>               case 'V':
>>                       printf(_("%s (%s)\n"),
>
>  "%s from %s\n" :-)

the version string are in new patch.

      mkfs.cramfs: coding style


The fixed & few new patches are available in the git repository at:
 https://github.com/kerolasa/lelux-utiliteetit cramfs

-- 
   Sami Kerola
   http://www.iki.fi/kerolasa/
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux