Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jan 2010 18:00:20 GMT
From:      Antoine Brodin <antoine@FreeBSD.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/142384: sync fsck_msdosfs with OpenBSD
Message-ID:  <201001061800.o06I0JfO029393@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/142384; it has been noted by GNATS.

From: Antoine Brodin <antoine@FreeBSD.org>
To: Pedro Giffuni <giffunip@tutopia.com>
Cc: freebsd-gnats-submit@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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001061800.o06I0JfO029393>