From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Pereira Habkost Subject: Re: Huh?? [PATCH] Date: Tue, 20 Jul 2004 12:18:25 -0300 Sender: linux-8086-owner@vger.kernel.org Message-ID: <20040720151825.GE6069@duckman.distro.conectiva> References: <20040720013827.95321.qmail@web51306.mail.yahoo.com> <20040720015804.29565.qmail@web51301.mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7iMSBzlTiPOCCT2k" Return-path: Content-Disposition: inline In-Reply-To: <20040720015804.29565.qmail@web51301.mail.yahoo.com> List-Id: To: linux-8086@vger.kernel.org --7iMSBzlTiPOCCT2k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 19, 2004 at 06:58:04PM -0700, Tommy McCabe wrote: > --- Tommy McCabe wrote: > > What the heck is if ((num =3D sys_execve("/bin/init", > > args, 18))) supposed to mean? num is an > > uninitialized > > variable which could equal anything. > >=20 >=20 > I found out what it means- it's supposed to set num > equal to sys_execve and then evaluate if that > statement is equal to 0. This, for some reason, is > compiled wrong and causes ELKS to hang at "Loading > init" at boot. The patch not only makes the intent > clearer but fixes the error. Have you tested and checked if the patch really fixes the hang? The "hang" at "Loading init" seems to be because init is running on the second pseudo-terminal (Alt+F2), and not because the code is compiled wrong. Anyway, *in my opinion* (people can disagree), the original code is shorter and clearer. And possibly generates smaller code when compiled by bcc (I am not sure, maybe bcc does some optmization, and the generated code is the same). Content-Description: init.diff > --- ./elkscomp/elks/init/main.c 2004-05-31 09:49:25.000000000 -0400 > +++ ./elkscurr/elks/init/main.c 2004-07-19 21:44:20.000000000 -0400 > @@ -98,8 +98,11 @@ > mount_root(); > =20 > printk("Loading init\n"); > - > - if ((num =3D sys_execve("/bin/init", args, 18))) { > + =20 > + num =3D sys_execve("/bin/init", args, 18); > + =20 > + if (num !=3D 0)=20 > + { > =20 > printk("sys_execve(\"/bin/init\",args,18) =3D> %d.\n",num); > =20 --=20 Eduardo --7iMSBzlTiPOCCT2k Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFA/TfBcaRJ66w1lWgRApyGAJ94Y27TqWkXk93PzE8SCvzwuNXJ2wCggW6F iytBlcMCTuqPCEWlgkq5J78= =p5eB -----END PGP SIGNATURE----- --7iMSBzlTiPOCCT2k--