From owner-svn-src-head@FreeBSD.ORG Wed Mar 11 14:30:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D54110656D6 for ; Wed, 11 Mar 2009 14:30:46 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from mail-out2.fuse.net (mail-out2.fuse.net [216.68.8.171]) by mx1.freebsd.org (Postfix) with ESMTP id E87248FC28 for ; Wed, 11 Mar 2009 14:30:45 +0000 (UTC) (envelope-from cokane@FreeBSD.org) X-CNFS-Analysis: v=1.0 c=1 a=iN0ZH7lpZ6IA:10 a=Hkso0HQtS48A:10 a=6I5d2MoRAAAA:8 a=kPvJ-YZLt_3HyXKtSPYA:9 a=J5-KrI2R02uQvptvSucA:7 a=E5kesLvNyGGyZjsibyfimvPnaZIA:4 a=LY0hPdMaydYA:10 a=YU2NQ9VS5T9TPjSJBtMA:9 a=1q0xXIetoTnHbNx0mm4F6mVDgXsA:4 a=rPt6xJ-oxjAA:10 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Authentication-Results: gwout2 smtp.mail=cokane@FreeBSD.org; spf=softfail Received-SPF: softfail (gwout2: transitional domain FreeBSD.org does not designate 74.215.227.9 as permitted sender) Received: from [74.215.227.9] ([74.215.227.9:50581] helo=discordia) by gwout2 (envelope-from ) (ecelerity 2.2.2.37 r(28805/28810M)) with ESMTP id 61/72-12703-51BC7B94; Wed, 11 Mar 2009 10:30:45 -0400 Received: by discordia (Postfix, from userid 103) id EEA2635A7DA; Wed, 11 Mar 2009 10:30:44 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.1.8-gr1 (2007-02-13) on discordia X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8-gr1 Received: from [172.31.1.6] (unknown [172.31.1.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by discordia (Postfix) with ESMTP id 3B96D35A7D8; Wed, 11 Mar 2009 10:30:33 -0400 (EDT) From: Coleman Kane To: Poul-Henning Kamp In-Reply-To: <1236781546.1906.5.camel@localhost> References: <200903111037.n2BAb2tj093282@svn.freebsd.org> <1236781546.1906.5.camel@localhost> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-A73AZhK6xQN6kp58QeK/" Organization: FreeBSD Project Date: Wed, 11 Mar 2009 10:29:19 -0400 Message-Id: <1236781759.1906.7.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.24.4 FreeBSD GNOME Team Port Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r189691 - head/sbin/recoverdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2009 14:30:47 -0000 --=-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/--