* Huh??
@ 2004-07-20 1:38 Tommy McCabe
2004-07-20 1:58 ` Huh?? [PATCH] Tommy McCabe
0 siblings, 1 reply; 3+ messages in thread
From: Tommy McCabe @ 2004-07-20 1:38 UTC (permalink / raw)
To: linux-8086
What the heck is if ((num = sys_execve("/bin/init",
args, 18))) supposed to mean? num is an uninitialized
variable which could equal anything.
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Huh?? [PATCH] 2004-07-20 1:38 Huh?? Tommy McCabe @ 2004-07-20 1:58 ` Tommy McCabe 2004-07-20 15:18 ` Eduardo Pereira Habkost 0 siblings, 1 reply; 3+ messages in thread From: Tommy McCabe @ 2004-07-20 1:58 UTC (permalink / raw) To: linux-8086 [-- Attachment #1: Type: text/plain, Size: 1028 bytes --] --- Tommy McCabe <rocketjet314@yahoo.com> wrote: > What the heck is if ((num = sys_execve("/bin/init", > args, 18))) supposed to mean? num is an > uninitialized > variable which could equal anything. > 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. > > __________________________________ > Do you Yahoo!? > Vote for the stars of Yahoo!'s next ad campaign! > http://advision.webevents.yahoo.com/yahoo/votelifeengine/ > > - > To unsubscribe from this list: send the line > "unsubscribe linux-8086" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at > http://vger.kernel.org/majordomo-info.html > __________________________________ Do you Yahoo!? Vote for the stars of Yahoo!'s next ad campaign! http://advision.webevents.yahoo.com/yahoo/votelifeengine/ [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: init.diff --] [-- Type: text/x-diff; name="init.diff", Size: 409 bytes --] --- ./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(); printk("Loading init\n"); - - if ((num = sys_execve("/bin/init", args, 18))) { + + num = sys_execve("/bin/init", args, 18); + + if (num != 0) + { printk("sys_execve(\"/bin/init\",args,18) => %d.\n",num); ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Huh?? [PATCH] 2004-07-20 1:58 ` Huh?? [PATCH] Tommy McCabe @ 2004-07-20 15:18 ` Eduardo Pereira Habkost 0 siblings, 0 replies; 3+ messages in thread From: Eduardo Pereira Habkost @ 2004-07-20 15:18 UTC (permalink / raw) To: linux-8086 [-- Attachment #1: Type: text/plain, Size: 1553 bytes --] On Mon, Jul 19, 2004 at 06:58:04PM -0700, Tommy McCabe wrote: > --- Tommy McCabe <rocketjet314@yahoo.com> wrote: > > What the heck is if ((num = sys_execve("/bin/init", > > args, 18))) supposed to mean? num is an > > uninitialized > > variable which could equal anything. > > > > 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(); > > printk("Loading init\n"); > - > - if ((num = sys_execve("/bin/init", args, 18))) { > + > + num = sys_execve("/bin/init", args, 18); > + > + if (num != 0) > + { > > printk("sys_execve(\"/bin/init\",args,18) => %d.\n",num); > -- Eduardo [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-07-20 15:18 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2004-07-20 1:38 Huh?? Tommy McCabe 2004-07-20 1:58 ` Huh?? [PATCH] Tommy McCabe 2004-07-20 15:18 ` Eduardo Pereira Habkost
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox