summaryrefslogtreecommitdiff
path: root/userspace/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/init.c')
-rw-r--r--userspace/init.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/userspace/init.c b/userspace/init.c
index f674fcd..b27dc8d 100644
--- a/userspace/init.c
+++ b/userspace/init.c
@@ -10,7 +10,8 @@ int main(int argc, char **argv)
time_t ltime;
time(&ltime);
- printf("Current time: %s", ctime(&ltime));
+ printf("fool-init: starting...\n");
+ printf("fool-init: current time: %s", ctime(&ltime));
printf("fool-init: spawning a Fool's Shell\n");
// loop forever and spawn shells if the top-shell exits
@@ -18,28 +19,20 @@ int main(int argc, char **argv)
{
int pid=_fork();
- printf("fool-init: pid: %i\n",pid);
- while(1);
+ printf("fool-init forked / pid: %i\n",pid);
int status;
-
- if(pid==1)
- {
- printf("fool-init: pid: %i\n",pid);
- }
if(pid==0)
{
- printf("fool-init: pid: %i\n",pid);
_execve("/bin/foolshell",argv1,env1); // replace process with our foolshell :)
- //execve("/bin/clear",argv,env); // replace process with our foolshell :)
puts("FATAL ERROR: Something terrible happened. Unable to Execute SHELL!");
while(1);// hang
}
// wait until our child process state changes (exits)
// and respawn SHELL
- while(1);
- _wait(&status);
+ //_wait(&status);
+ while(1)printf(".");
printf("fool-init: catched exit of process %d.\n",pid);
printf("fool-init: respawning a Fools Shell\n");