summaryrefslogtreecommitdiff
path: root/userspace/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/init.c')
-rw-r--r--userspace/init.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/userspace/init.c b/userspace/init.c
index e04e7ce..a367fd9 100644
--- a/userspace/init.c
+++ b/userspace/init.c
@@ -7,28 +7,28 @@ int main(int argc, char **argv)
char *argv1[]={"/bin/foolshell",0};
char *env1[]={"PS1=\033[34m$\033[37m","PWD=/home/miguel","PATH=/bin","TERM=fool-term",0};
+ printf("fool-init\n");
time_t ltime;
time(&ltime);
- printf("fool-init: current time: %s", ctime(&ltime));
+ printf("fool-init: current time: %s\n", ctime(&ltime));
// loop forever and spawn shells if the top-shell exits
while(1)
{
int pid=_fork();
+ printf("fool-init: forked pid=%d\n", pid);
- int status;
if(pid==0)
{
_execve("/bin/foolshell",argv1,env1); // replace process with our foolshell :)
- puts("FATAL ERROR: Something terrible happened. Unable to Execute SHELL!");
- while(1);// hang
+ while(1) puts("FATAL ERROR: Something terrible happened. Unable to Execute SHELL!\n");
}
// wait until our child process state changes (exits)
// and respawn SHELL
- _wait(&status);
+ _wait(pid);
printf("fool-init: catched exit of process %d.\n",pid);
printf("fool-init: respawning a Fools Shell\n");