bin/142384: sync fsck_msdosfs with OpenBSD

Antoine Brodin antoine at FreeBSD.org
Wed Jan 6 18:00:21 UTC 2010


The following reply was made to PR bin/142384; it has been noted by GNATS.

From: Antoine Brodin <antoine at FreeBSD.org>
To: Pedro Giffuni <giffunip at tutopia.com>
Cc: freebsd-gnats-submit at freebsd.org
Subject: Re: bin/142384: sync fsck_msdosfs with OpenBSD
Date: Wed, 6 Jan 2010 18:24:20 +0100

 On Wed, Jan 6, 2010 at 5:50 PM, Pedro Giffuni <giffunip at tutopia.com> wrote:
 [snip]
 > diff -ru fsck_msdosfs.orig/boot.c fsck_msdosfs/boot.c
 > --- fsck_msdosfs.orig/boot.c =A0 =A02010-01-06 11:07:24.000000000 +0000
 > +++ fsck_msdosfs/boot.c 2010-01-06 11:19:21.000000000 +0000
 > @@ -55,9 +55,9 @@
 > =A0 =A0 =A0 =A0u_char block[DOSBOOTBLOCKSIZE];
 > =A0 =A0 =A0 =A0u_char fsinfo[2 * DOSBOOTBLOCKSIZE];
 > =A0 =A0 =A0 =A0u_char backup[DOSBOOTBLOCKSIZE];
 > - =A0 =A0 =A0 int ret =3D FSOK;
 > + =A0 =A0 =A0 int n, ret =3D FSOK;
 >
 > - =A0 =A0 =A0 if (read(dosfs, block, sizeof block) < sizeof block) {
 > + =A0 =A0 =A0 if ((n=3D(read(dosfs, block, sizeof block) < sizeof block))=
  =3D=3D -1 || n !=3D sizeof block) {
 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0perror("could not read boot block");
 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return FSFATAL;
 > =A0 =A0 =A0 =A0}
 
 This does not look right, you probably want:
  if ((n =3D read(dosfs, block, sizeof(block))) =3D=3D -1 || n !=3D sizeof(b=
 lock))
 
 Cheers,
 
 Antoine


More information about the freebsd-bugs mailing list