Huh??
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/
Re: Huh?? [PATCH]
Quoted 5 lines · --- Tommy McCabe
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.
Quoted 5 lines
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/
Quoted 8 lines
-
To unsubscribe from this list: send the line "unsubscribe linux-8086" in
the body of a message to [email protected] 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/
elkscurr/elks/init/main.c renamed from elkscomp/elks/init/main.c +5 -2
@@ -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);
Re: Huh?? [PATCH]
Quoted 7 lines · Tommy McCabe
Quoted 5 lines · --- Tommy McCabe
What the heck is if ((num =
sys_execve("/bin/init", args, 18))) supposed to mean? num is an uninitialized
variable which could equal anything.
Quoted 6 lines
I found out what it means- it's supposed to set num equal to
sys_execveand 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
Quoted 16 lines
elkscurr/elks/init/main.c renamed from elkscomp/elks/init/main.c +5
-2@@ -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);
Signature · 1 line
Eduardo