Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Mar 2009 10:29:19 -0400
From:      Coleman Kane <cokane@FreeBSD.org>
To:        Poul-Henning Kamp <phk@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r189691 - head/sbin/recoverdisk
Message-ID:  <1236781759.1906.7.camel@localhost>
In-Reply-To: <1236781546.1906.5.camel@localhost>
References:  <200903111037.n2BAb2tj093282@svn.freebsd.org> <1236781546.1906.5.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-A73AZhK6xQN6kp58QeK/
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Wed, 2009-03-11 at 10:25 -0400, Coleman Kane wrote:
> On Wed, 2009-03-11 at 10:37 +0000, Poul-Henning Kamp wrote:
> > Author: phk
> > Date: Wed Mar 11 10:37:02 2009
> > New Revision: 189691
> > URL: http://svn.freebsd.org/changeset/base/189691
> >=20
> > Log:
> >   Some improvements to recoverdisk
> >=20
> > Modified:
> >   head/sbin/recoverdisk/recoverdisk.1
> >   head/sbin/recoverdisk/recoverdisk.c
> >=20
>=20
> < ... snip ... >
>=20
> >=20
> > Modified: head/sbin/recoverdisk/recoverdisk.c
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
> > --- head/sbin/recoverdisk/recoverdisk.c	Wed Mar 11 09:57:11 2009	(r1896=
90)
> > +++ head/sbin/recoverdisk/recoverdisk.c	Wed Mar 11 10:37:02 2009	(r1896=
91)
>=20
> < ... snip ... >
>=20
> > @@ -215,6 +213,17 @@ main(int argc, char * const argv[])
> >  		flags |=3D O_CREAT | O_TRUNC;
> >  	}
> > =20
> > +	if (bigsize < minsize)
> > +		bigsize =3D minsize;
> > +
> > +	for (ch =3D 0; (bigsize >> ch) > minsize; ch++)
> > +		continue;
> > +	medsize =3D bigsize >> (ch / 2);
> > +	medsize =3D (medsize / minsize) * minsize;
> > +
> > +	fprintf(stderr, "Bigsize =3D %u, medsize =3D %u, minsize =3D %u\n",
> > +	    bigsize, medsize, minsize);
> > +
> >  	buf =3D malloc(bigsize);
> >  	if (buf =3D=3D NULL)
> >  		err(1, "Cannot allocate %jd bytes buffer", (intmax_t)bigsize);
> > =20
>=20
> That new fprintf warns in the case where sizeof(size_t) !=3D
> sizeof(unsigned int), such as is the case on amd64.
>=20

A quick read of the printf(3) page suggests

printf(stderr, "Bigsize =3D %zu, medsize =3D %zu, minsize =3D %zu\n", bigsi=
ze,
medsize, minsize);

is more appropriate... I think.

--=20
Coleman Kane

--=-A73AZhK6xQN6kp58QeK/
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEABECAAYFAkm3yr0ACgkQcMSxQcXat5fNFACggcThnC8APxejBk9WbtFRn6Jf
BzUAn0cLd+ZY0vmGMHWhGIJdLb/dQ3a1
=elo6
-----END PGP SIGNATURE-----

--=-A73AZhK6xQN6kp58QeK/--




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