From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Vjqom-0002ql-W5 for mharc-grub-devel@gnu.org; Fri, 22 Nov 2013 08:30:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vjqof-0002ot-MP for grub-devel@gnu.org; Fri, 22 Nov 2013 08:30:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjqoZ-0007i0-UZ for grub-devel@gnu.org; Fri, 22 Nov 2013 08:30:37 -0500 Received: from mail-ea0-x22c.google.com ([2a00:1450:4013:c01::22c]:63525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjqoZ-0007hr-KN for grub-devel@gnu.org; Fri, 22 Nov 2013 08:30:31 -0500 Received: by mail-ea0-f172.google.com with SMTP id q10so515407ead.17 for ; Fri, 22 Nov 2013 05:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=BdroenxOa483rbyG9iXO2Fw6ZCa5Lu+HRd7jzFWICtg=; b=Ov1a2I009pETwaTDC/VwUif8rtMb4DPKVAV6B9RZ5qSFU5Plxo8Y7j/NweQoOUN+Od nn/BzyFtxKIRAbecZ0mPnsS1tYPE47L/j91vIc35jWTOTPElzZIH+mJda3V8WNurrajR ETI8h85NEZmnZs/W201nv/cicresSwK86Mk8Zv6gYyMmXEaFlCOOYBPcfA1na8n9z49M Ct1jmvLQq9fMiLD9VJBN1q9tmimBTA6HDC+5ReDiC0fq3CtPJMV4YQ6kiUHq0uYnglMA STsOp7/2E3YVGP09ih5kgW5m7eyqqUMPrKNhzXXzIQwO0BS/PF31zHvIg2VoGs2f8Vcg +PeQ== X-Received: by 10.14.207.6 with SMTP id m6mr78751eeo.79.1385127030637; Fri, 22 Nov 2013 05:30:30 -0800 (PST) Received: from [192.168.1.121] (31-249.1-85.cust.bluewin.ch. [85.1.249.31]) by mx.google.com with ESMTPSA id g47sm78187918eeo.19.2013.11.22.05.30.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Nov 2013 05:30:29 -0800 (PST) Message-ID: <528F5C74.5080006@gmail.com> Date: Fri, 22 Nov 2013 14:30:28 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: grub2 boot root-on-zfs errors References: <528F0806.5000004@gmail.com> <20131122131652.GA19341@riva.ucam.org> In-Reply-To: <20131122131652.GA19341@riva.ucam.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2QXVJXWAJRUWKGUUETTDU" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Nov 2013 13:30:43 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2QXVJXWAJRUWKGUUETTDU Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 22.11.2013 14:16, Colin Watson wrote: > On Fri, Nov 22, 2013 at 08:30:14AM +0100, Vladimir '=CF=86-coder/phcode= r' Serbinenko wrote: >> On 22.11.2013 08:09, Beeblebrox wrote: >>> grub-core/osdep/unix/platform.c:34:28: error: use of undeclared >>> identifier 'PATH_MAX' >>> char *ret =3D xmalloc (2 * PATH_MAX); >> Please try >> diff --git a/grub-core/osdep/unix/platform.c >> b/grub-core/osdep/unix/platform.c >> index 65c93f1..a527a1c 100644 >> --- a/grub-core/osdep/unix/platform.c >> +++ b/grub-core/osdep/unix/platform.c >> @@ -27,6 +27,7 @@ >> #include >> #include >> #include >> +#include >> >> static char * >> get_ofpathname (const char *dev) >> >=20 > This will not be sufficient to build on GNU/Hurd (get_ofpathname isn't > directly relevant to that platform, but that function will be compiled > there anyway). We need to avoid the use of PATH_MAX entirely, per: >=20 > https://www.gnu.org/software/hurd/hurd/porting/guidelines.html >=20 Sth like diff --git a/grub-core/osdep/unix/platform.c b/grub-core/osdep/unix/platf= orm.c index 65c93f1..684c325 100644 --- a/grub-core/osdep/unix/platform.c +++ b/grub-core/osdep/unix/platform.c @@ -31,11 +31,11 @@ static char * get_ofpathname (const char *dev) { - char *ret =3D xmalloc (2 * PATH_MAX); - char *end =3D ret + 2 * PATH_MAX - 1; + size_t alloced =3D 4096; + char *ret =3D xmalloc (alloced); + size_t offset =3D 0; int fd; pid_t pid; - char *ptr =3D ret; =20 pid =3D grub_util_exec_pipe ((const char * []){ "ofpathname", dev, NUL= L }, &fd); if (!pid) @@ -45,11 +45,16 @@ get_ofpathname (const char *dev) if (!fp) goto fail; =20 - while (!feof (fp) && ptr < end) + while (!feof (fp)) { size_t r; - r =3D fread (ptr, 1, end - ptr, fp); - ptr +=3D r; + if (alloced =3D=3D offset) + { + alloced *=3D 2; + ret =3D xrealloc (ret, alloced); + } + r =3D fread (ret + offset, 1, alloced - offset, fp); + offset +=3D r; } =20 fclose (fp); ------enig2QXVJXWAJRUWKGUUETTDU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlKPXHQACgkQmBXlbbo5nOu83gD/aQNTuWzq6chBl3a1QzJY+lpe NVk055NNj/S3ib+oQmkBAIQqQKIS1+1ZNLLmvTX+FZKk4gXQDF3uFBmlZcfW935O =L13Y -----END PGP SIGNATURE----- ------enig2QXVJXWAJRUWKGUUETTDU--